Files
supabase/apps/studio/data/analytics/utils.ts
Saxon Fletcher 622486f750 Refresh report and status update (#39473)
* refresh report

* project status

* prettier

* Minor refactors

* add back refreshing

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-14 08:09:48 +10:00

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 }
}