mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
remove query keys when deleting individual entities (#1832)
When deleting individual entities, their query keys should be removed, not only invalidated. This is to prevent situations, where an entity is deleted via the web interface and react-query attempts a re-fetch before a redirect to the collection view can occur. This could lead to a not found error.
This commit is contained in:
committed by
GitHub
parent
6a881b3d98
commit
d41b293109
@@ -127,7 +127,7 @@ export const useDeleteRepositoryRole = () => {
|
||||
},
|
||||
{
|
||||
onSuccess: async (_, name) => {
|
||||
await queryClient.invalidateQueries(["repositoryRole", name]);
|
||||
await queryClient.removeQueries(["repositoryRole", name]);
|
||||
await queryClient.invalidateQueries(["repositoryRoles"]);
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user