mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
37 lines
757 B
TypeScript
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 }
|
|
}
|