2 Commits

Author SHA1 Message Date
1b27fa32ce worked on the aboutus 2025-02-12 13:19:36 +05:30
6f25a6a234 worked privacypolicy 2025-02-12 12:47:44 +05:30
4 changed files with 27 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ const AboutUs = () => {
const content = data?.data?.[0]?.content
console.log('====================================');
// console.log(response);
console.log(data);
console.log('====================================');

View File

@@ -9,13 +9,13 @@ const PrivacyPolicy = () => {
const { data, isLoading } = useGetPrivacyPolicyQuery();
console.log(isLoading);
// Log the response for debugging
console.log("====================================");
console.log("====================================");
console.log(data);
console.log("====================================");
// Extract content array from the response
const content = data?.data?.[0]?.content;

View File

@@ -1,6 +1,6 @@
import { createApi } from "@reduxjs/toolkit/query/react";
import { baseQueryWithReauth } from "./apiSlice";
import { AboutUsResponse } from "../../Types/aboutUsType";
export const aboutUs = createApi({
reducerPath: "aboutUs",
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
@@ -94,10 +94,3 @@ export type AboutUs = {
is_active: boolean;
};
// First define your interface
interface AboutUsResponse {
data: {
content: string;
// other fields...
}[];
}

22
src/Types/aboutUsType.tsx Normal file
View File

@@ -0,0 +1,22 @@
// First define your interface
// export interface AboutUsResponse {
// data: {
// content: string;
// // other fields...
// }[];
// }
export interface AboutUsContent {
id: number;
language_master_xid: number;
content: string;
is_active: boolean;
}
export interface AboutUsResponse {
status: "success" | "error"; // Assuming it can be "success" or "error"
status_code: number;
message: string;
data: AboutUsContent[];
}