fix: removed staleTime and cacheTime from query client level (#9124)

* fix: removed staleTime for dashboard API, to fetch fresh data while switching between dashboards

* fix: removed query client level staleTime and cacheTime

* fix: adding dashbaordID to the query key

* fix: removed unnecessary query key
This commit is contained in:
SagarRajput-7 2025-09-19 10:55:19 +05:30 committed by GitHub
parent 47e8a89dbe
commit 792d0f3db6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View File

@ -16,8 +16,6 @@ const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
staleTime: 2 * 60 * 1000, // 2 minutes - data becomes stale after 2 minutes
cacheTime: 5 * 60 * 1000, // 5 minutes - cache entries are garbage collected after 5 minutes
retry(failureCount, error): boolean {
if (
// in case of manually throwing errors please make sure to send error.response.status

View File

@ -269,7 +269,7 @@ export function DashboardProvider({
return data;
};
const dashboardResponse = useQuery(
[REACT_QUERY_KEY.DASHBOARD_BY_ID, isDashboardPage?.params],
[REACT_QUERY_KEY.DASHBOARD_BY_ID, dashboardId],
{
enabled: (!!isDashboardPage || !!isDashboardWidgetPage) && isLoggedIn,
queryFn: async () => {