diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-12-04 17:53:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 17:53:22 -0800 |
commit | d07ea64434709f1ce43bde3d6e45ca4dc99b0733 (patch) | |
tree | 6bfaf69dbe213a110538acd7eb9d90c0f9841884 /src | |
parent | 160055e4f96762567c69c3f2629ec03ad64fb4d7 (diff) | |
download | voidsky-d07ea64434709f1ce43bde3d6e45ca4dc99b0733.tar.zst |
Fix: correctly partial-match when calling truncateAndInvalidate() (#2088)
Diffstat (limited to 'src')
-rw-r--r-- | src/state/queries/util.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state/queries/util.ts b/src/state/queries/util.ts index 0b3eefea2..ed91a8f2a 100644 --- a/src/state/queries/util.ts +++ b/src/state/queries/util.ts @@ -2,9 +2,9 @@ import {QueryClient, QueryKey, InfiniteData} from '@tanstack/react-query' export function truncateAndInvalidate<T = any>( queryClient: QueryClient, - querykey: QueryKey, + queryKey: QueryKey, ) { - queryClient.setQueryData<InfiniteData<T>>(querykey, data => { + queryClient.setQueriesData<InfiniteData<T>>({queryKey}, data => { if (data) { return { pageParams: data.pageParams.slice(0, 1), @@ -13,5 +13,5 @@ export function truncateAndInvalidate<T = any>( } return data }) - queryClient.invalidateQueries({queryKey: querykey}) + queryClient.invalidateQueries({queryKey}) } |