How to trigger a function when a query is disabled? - TanStack