Skip to content

Commit

Permalink
invalidateOptions to endpointQueryKey
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Dec 6, 2024
1 parent ae28b8a commit a205b25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/api/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export type PaginatedQuery<TData> = {
* Options to pass to `queryClient.invalidateQueries` that will invalidate all
* cached queries to this endpoint, regardless of parameters.
*/
invalidateOptions: { queryKey: readonly [string] }
endpointQueryKey: { queryKey: readonly [string] }
}

/**
Expand Down Expand Up @@ -179,7 +179,7 @@ export const getListQueryOptionsFn =
})
},
pageSize: limit,
invalidateOptions: { queryKey: [method] },
endpointQueryKey: { queryKey: [method] },
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/pages/ProjectsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function Component() {

const { mutateAsync: deleteProject } = useApiMutation('projectDelete', {
onSuccess() {
queryClient.invalidateQueries(projectList.invalidateOptions)
queryClient.invalidateQueries(projectList.endpointQueryKey)
},
})

Expand Down

0 comments on commit a205b25

Please sign in to comment.