diff --git a/dev-dist/sw.js b/dev-dist/sw.js index 2892c8c..bcb0387 100644 --- a/dev-dist/sw.js +++ b/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.s1fup7lrbig" + "revision": "0.vu9poovgqsg" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/Pages/ManageCMS/PrivacyPolicy/PrivacyPolicy.tsx b/src/Pages/ManageCMS/PrivacyPolicy/PrivacyPolicy.tsx index d6fa126..6397e9f 100644 --- a/src/Pages/ManageCMS/PrivacyPolicy/PrivacyPolicy.tsx +++ b/src/Pages/ManageCMS/PrivacyPolicy/PrivacyPolicy.tsx @@ -2,9 +2,17 @@ import { Box, HStack, Text } from "@chakra-ui/react"; import MainFrame from "../../../components/MainFrame" import { p } from "framer-motion/client"; import PrivacyPolicyAddModel from "./PrivacyPolicyAddModel"; - - +import { useGetPrivacyPolicyQuery } from "../../../Redux/Service/privacy.policy.service.ts"; const PrivacyPolicy = () => { + + const { + data + } = useGetPrivacyPolicyQuery() + + console.log('============================'); + console.log(data); + console.log('============================'); + return ( @@ -21,7 +29,6 @@ const PrivacyPolicy = () => { - diff --git a/src/Redux/Service/manage.aboutus.service.ts b/src/Redux/Service/manage.aboutus.service.ts index 300f497..6b82556 100644 --- a/src/Redux/Service/manage.aboutus.service.ts +++ b/src/Redux/Service/manage.aboutus.service.ts @@ -52,17 +52,6 @@ export const aboutUs = createApi({ export const { useGetAboutUsQuery, - - - - - - - - - - - useGetPostByIdQuery, useCreatePostMutation, useUpdatePostMutation, diff --git a/src/Redux/Service/privacy.policy.service.ts b/src/Redux/Service/privacy.policy.service.ts index b7e3126..4eaf5ac 100644 --- a/src/Redux/Service/privacy.policy.service.ts +++ b/src/Redux/Service/privacy.policy.service.ts @@ -1,26 +1,67 @@ -import { createApi } from "@reduxjs/toolkit/query"; +import { createApi } from "@reduxjs/toolkit/query/react"; // Fix import import { baseQueryWithReauth } from "./apiSlice"; + + export const privacyPolicy = createApi({ - reducerPath: "privacyPolicy", - baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling - endpoints: (builder) => ({ - - - - getPosts: builder.query({ query: () => "/posts" }), - - - - - + reducerPath: "privacyPolicy", + baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling + endpoints: (builder) => ({ + // 🔹 GET: Fetch all privacy policies + getPrivacyPolicy: builder.query({ + query: () => "/privacy-policy", }), - }); + + // 🔹 GET: Fetch a single post by ID + // getPostById: builder.query({ + // query: (id) => `/posts/${id}`, + // }), + + // 🔹 POST: Create a new post + // createPost: builder.mutation>({ + // query: (newPost) => ({ + // url: "/posts", + // method: "POST", + // body: newPost, + // }), + // }), + + // 🔹 PUT: Update an existing post + // updatePost: builder.mutation }>({ + // query: ({ id, updatedData }) => ({ + // url: `/posts/${id}`, + // method: "PUT", + // body: updatedData, + // }), + // }), + + // 🔹 DELETE: Remove a post by ID + // deletePost: builder.mutation<{ success: boolean }, number>({ + // query: (id) => ({ + // url: `/posts/${id}`, + // method: "DELETE", + // }), + // }), + }), +}); + +// Export hooks for usage in components +export const { + useGetPrivacyPolicyQuery, // Export the correct hook - export const { } = privacyPolicy; - - export type Post = { - id: number; - title: string; - body: string; - }; \ No newline at end of file +} = privacyPolicy; + + +// Define types at the top for better readability +export type Post = { + id: number; + title: string; + body: string; +}; + +export type PrivacyPolicy = { + id: number; + language_master_xid: number; + content: string; + is_active: boolean; +}; \ No newline at end of file