From edbd05fa6c4058931fd8015bff96dd4d5a5da1cc Mon Sep 17 00:00:00 2001 From: KarimAldeen Date: Sat, 30 Mar 2024 12:18:49 +0300 Subject: [PATCH] Done --- src/Layout/app/ErrorPage.tsx | 2 +- src/api/Categories.ts | 2 +- src/api/product.ts | 2 +- src/api/supportmessages.ts | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Layout/app/ErrorPage.tsx b/src/Layout/app/ErrorPage.tsx index 42bc875..c8ce7f0 100644 --- a/src/Layout/app/ErrorPage.tsx +++ b/src/Layout/app/ErrorPage.tsx @@ -16,7 +16,7 @@ const ErrorPage: React.FC = () => { const firstPath = location.pathname.split('/')[1]; // Get the first path segment from the URL console.log(firstPath,"firstPath"); - queryClient.invalidateQueries(firstPath); + queryClient.invalidateQueries(firstPath === "/" ? 'home' : firstPath); }; const handleGoToLogin = () => { diff --git a/src/api/Categories.ts b/src/api/Categories.ts index 276f3ab..8341899 100644 --- a/src/api/Categories.ts +++ b/src/api/Categories.ts @@ -14,7 +14,7 @@ const API = { UPDATE: `category`, }; -const KEY = "category" +const KEY = "categories" export const useGetCategories = (params?:any) => useGetQueryPagination(KEY, API.GET_ALL,params); diff --git a/src/api/product.ts b/src/api/product.ts index c494f30..593d2b4 100644 --- a/src/api/product.ts +++ b/src/api/product.ts @@ -18,7 +18,7 @@ const API = { }; -const KEY = "product" +const KEY = "products" // const ONEKEY = "Product" diff --git a/src/api/supportmessages.ts b/src/api/supportmessages.ts index 6489cf7..412ea52 100644 --- a/src/api/supportmessages.ts +++ b/src/api/supportmessages.ts @@ -3,8 +3,6 @@ import useGetQueryPagination from "./helper/ueGetPagination"; import useAddMutation from "./helper/useAddMutation" import useDeleteMutation from "./helper/useDeleteMutation" import useGetOneQuery from "./helper/useGetOneQuery"; -import useGetQuery from "./helper/useGetQuery" -import useUpdateMutation from "./helper/useUpdateMutation"; import useUpdateMutationById from "./helper/useUpdateMutationById"; const API = { @@ -14,7 +12,7 @@ const API = { UPDATE: `SupportMessages`, }; -const KEY = "SupportMessages" +const KEY = "support_messages" export const useGetSupportMessages = (params?:any) => useGetQueryPagination(KEY, API.GET_ALL,params);