From b3dab25fa9fe93aaa614c9e0bcebe1e8196573b2 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Wed, 11 Dec 2024 20:47:25 +0100 Subject: [PATCH] accout dash API fix --- src/App.js | 9 ++++++++- src/component/home/HomeSections.jsx | 4 +--- src/services/services.js | 3 +-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/App.js b/src/App.js index ee9a893..2cac372 100644 --- a/src/App.js +++ b/src/App.js @@ -17,7 +17,14 @@ import axios from 'axios'; function App() { - const queryClient = new QueryClient() + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + // staleTime: Infinity, + refetchOnWindowFocus: false + }, + }, + }) return ( diff --git a/src/component/home/HomeSections.jsx b/src/component/home/HomeSections.jsx index 5d38577..e930d54 100644 --- a/src/component/home/HomeSections.jsx +++ b/src/component/home/HomeSections.jsx @@ -10,11 +10,9 @@ export default function HomeSections(){ const {data:dashData, isFetching, isError} = useQuery({ queryKey: queryKeys.dashboard, - queryFn: accountDashboard() + queryFn: async () => await accountDashboard() }) - console.log('DASH', dashData) - if(isFetching){ return( <> diff --git a/src/services/services.js b/src/services/services.js index c17ffbd..d971b13 100644 --- a/src/services/services.js +++ b/src/services/services.js @@ -49,7 +49,6 @@ export const loginUser = (reqData) => { // FUNCTION TO GET DASHBOARD DATA -export const accountDashboard = (query) => { - // return getAuxEnd(`/panel/account/dash?${query}`) +export const accountDashboard = () => { return getAuxEnd(`/panel/account/dash`) }