Files
supabase/apps/studio/data/analytics/utils.ts

37 lines
757 B
TypeScript

import { useQueryClient } from '@tanstack/react-query'
import { analyticsKeys } from './keys'
export const useInvalidateAnalyticsQuery = () => {
const queryClient = useQueryClient()
const invalidateInfraMonitoringQuery = (
ref: string,
{
attribute,
startDate,
endDate,
interval,
databaseIdentifier,
}: {
attribute?: string
startDate?: string
endDate?: string
interval?: string
databaseIdentifier?: string
}
) => {
queryClient.invalidateQueries({
queryKey: analyticsKeys.infraMonitoring(ref, {
attribute,
startDate,
endDate,
interval,
databaseIdentifier,
}),
})
}
return { invalidateInfraMonitoringQuery }
}