mirror of
https://github.com/supabase/supabase.git
synced 2026-07-05 03:24:19 +08:00
* refresh report * project status * prettier * Minor refactors * add back refreshing --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
36 lines
743 B
TypeScript
36 lines
743 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(
|
|
analyticsKeys.infraMonitoring(ref, {
|
|
attribute,
|
|
startDate,
|
|
endDate,
|
|
interval,
|
|
databaseIdentifier,
|
|
})
|
|
)
|
|
}
|
|
|
|
return { invalidateInfraMonitoringQuery }
|
|
}
|