Compare commits
2 Commits
tufail
...
1b27fa32ce
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b27fa32ce | |||
| 6f25a6a234 |
@@ -11,7 +11,7 @@ const AboutUs = () => {
|
||||
|
||||
const content = data?.data?.[0]?.content
|
||||
console.log('====================================');
|
||||
// console.log(response);
|
||||
console.log(data);
|
||||
console.log('====================================');
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
22
src/Types/aboutUsType.tsx
Normal 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[];
|
||||
}
|
||||
Reference in New Issue
Block a user