Skip to content

Commit

Permalink
fix transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasiliy Trushin committed Jan 17, 2025
1 parent 995c40e commit e34ff87
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions statshouse-ui/src/api/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { toNumber } from '@/common/helpers';
import { API_HISTORY } from './history';

const ApiDashboardEndpoint = '/api/dashboard';
const ApiDashboardEndpointGet = '/api/dashboard/get';
const ApiDashboardEndpointSave = '/api/dashboard/save';

/**
Expand Down Expand Up @@ -89,7 +88,7 @@ export function getDashboardOptions<T = ApiDashboard>(
}

return {
queryKey: [ApiDashboardEndpointGet, fetchParams],
queryKey: [ApiDashboardEndpoint, fetchParams],
queryFn: async ({ signal }) => {
const { response, error } = await apiDashboardFetch(fetchParams, signal);

Expand Down Expand Up @@ -200,8 +199,8 @@ export function getDashboardSaveOptions(
}
queryClient.setQueryData([ApiDashboardEndpointSave, fetchParams], data);

// need to invalidate all ApiDashboardEndpointGet keys after saving to avoid errors
queryClient.invalidateQueries({ queryKey: [ApiDashboardEndpointGet] });
// need to invalidate all ApiDashboardEndpoint (GET request) keys after saving to avoid errors
queryClient.invalidateQueries({ queryKey: [ApiDashboardEndpoint] });
queryClient.refetchQueries({ queryKey: [API_HISTORY, dashboardId] });
}
},
Expand Down

0 comments on commit e34ff87

Please sign in to comment.