mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-11-03 20:15:52 +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
				
			@@ -128,7 +128,7 @@ export const useDeleteUser = () => {
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      onSuccess: async (_, name) => {
 | 
			
		||||
        await queryClient.invalidateQueries(["user", name]);
 | 
			
		||||
        await queryClient.removeQueries(["user", name]);
 | 
			
		||||
        await queryClient.invalidateQueries(["users"]);
 | 
			
		||||
      },
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user