feat: fixed cleanup on leaving root and api issue in frontend

This commit is contained in:
=
2025-10-21 23:29:19 +05:30
parent bd57640313
commit 8a1b572813
5 changed files with 22 additions and 18 deletions
+11 -1
View File
@@ -1,11 +1,12 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createRootRouteWithContext, Outlet } from "@tanstack/react-router";
import { createRootRouteWithContext, Outlet, useSearch } from "@tanstack/react-router";
import { NotificationContainer } from "@app/components/notifications";
import { TooltipProvider } from "@app/components/v2";
import { adminQueryKeys, fetchServerConfig } from "@app/hooks/api/admin/queries";
import { TServerConfig } from "@app/hooks/api/admin/types";
import { queryClient } from "@app/hooks/api/reactQuery";
import { useEffect } from "react";
type TRouterContext = {
serverConfig: TServerConfig | null;
@@ -13,6 +14,15 @@ type TRouterContext = {
};
const RootPage = () => {
const subOrganization = useSearch({
strict: false,
select: (el) => el?.subOrganization
});
useEffect(() => {
queryClient.clear();
}, [subOrganization]);
return (
<QueryClientProvider client={queryClient}>
<TooltipProvider>