Skip to content

Commit

Permalink
fix: invalidate models
Browse files Browse the repository at this point in the history
  • Loading branch information
peppescg committed Feb 14, 2025
1 parent 375078f commit c6bcee0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/features/providers/hooks/use-invalidate-providers-queries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { v1ListProviderEndpointsQueryKey } from '@/api/generated/@tanstack/react-query.gen'
import {
v1ListAllModelsForAllProvidersQueryKey,
v1ListProviderEndpointsQueryKey,
} from '@/api/generated/@tanstack/react-query.gen'
import { useQueryClient } from '@tanstack/react-query'
import { useCallback } from 'react'
import { invalidateQueries } from '../../../lib/react-query-utils'
Expand All @@ -7,7 +10,10 @@ export function useInvalidateProvidersQueries() {
const queryClient = useQueryClient()

const invalidate = useCallback(async () => {
invalidateQueries(queryClient, [v1ListProviderEndpointsQueryKey])
invalidateQueries(queryClient, [
v1ListProviderEndpointsQueryKey,
v1ListAllModelsForAllProvidersQueryKey,
])
}, [queryClient])

return invalidate
Expand Down

0 comments on commit c6bcee0

Please sign in to comment.