From 84a64c9ae6f72d1fb46d0d11a94f596376635d68 Mon Sep 17 00:00:00 2001 From: "parth.ramani" Date: Wed, 12 Feb 2025 12:04:00 +0530 Subject: [PATCH] worked on the aboutus --- src/Pages/ManageCMS/AboutUs/AboutUs.tsx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Pages/ManageCMS/AboutUs/AboutUs.tsx b/src/Pages/ManageCMS/AboutUs/AboutUs.tsx index 89a481e..acc13b6 100644 --- a/src/Pages/ManageCMS/AboutUs/AboutUs.tsx +++ b/src/Pages/ManageCMS/AboutUs/AboutUs.tsx @@ -1,15 +1,17 @@ -import { Box, Center, HStack, Skeleton, Spinner, Text } from "@chakra-ui/react"; +import { Box, HStack, Skeleton, Text } from "@chakra-ui/react"; import MainFrame from "../../../components/MainFrame" -import { p } from "framer-motion/client"; import AboutUsAddModel from "../../ManageCMS/AboutUs/AboutUsAddModel"; import { useGetAboutUsQuery } from "../../../Redux/Service/manage.aboutus.service"; -interface AboutUs { +interface AboutUsContent { content: string; } interface ApiResponse { - data: AboutUs[]; + data: AboutUsContent[]; +} +interface AboutUs { + content: string; } @@ -18,13 +20,18 @@ const AboutUs = () => { // const { // data: data // } = useGetAboutUsQuery() - // const { data: response, isLoading } = useGetAboutUsQuery<{ data: ApiResponse }>(); - const { data: response, isLoading } = useGetAboutUsQuery(); + // const { data: response,isLoading, } = useGetAboutUsQuery<{ data: ApiResponse }>(); + + // Simple way to fetch data + const { data } = useGetAboutUsQuery(); + + // Safely access the first content item + const content = data?.data?.[0]?.content; console.log('===================================='); console.log(response); console.log('===================================='); - const content = response?.data?.[0]?.content; + // const content = response?.data?.[0]?.content; return (