@@ -6382,6 +6382,14 @@ export function useRbacUserAssignments(options?: {
63826382 const queryClient = useQueryClient ( )
63836383 const enabled = options ?. enabled ?? true
63846384
6385+ const invalidateAssignmentQueries = async ( ) => {
6386+ await Promise . all ( [
6387+ queryClient . invalidateQueries ( { queryKey : [ "rbac-user-assignments" ] } ) ,
6388+ queryClient . invalidateQueries ( { queryKey : [ "user-scopes" ] } ) ,
6389+ queryClient . invalidateQueries ( { queryKey : [ "org-members" ] } ) ,
6390+ ] )
6391+ }
6392+
63856393 // List user assignments
63866394 const {
63876395 data : userAssignments ,
@@ -6409,9 +6417,8 @@ export function useRbacUserAssignments(options?: {
64096417 } = useMutation ( {
64106418 mutationFn : async ( params : UserRoleAssignmentCreate ) =>
64116419 await rbacCreateUserAssignment ( { requestBody : params } ) ,
6412- onSuccess : ( ) => {
6413- queryClient . invalidateQueries ( { queryKey : [ "rbac-user-assignments" ] } )
6414- queryClient . invalidateQueries ( { queryKey : [ "user-scopes" ] } )
6420+ onSuccess : async ( ) => {
6421+ await invalidateAssignmentQueries ( )
64156422 toast ( {
64166423 title : "User assignment created" ,
64176424 description : "Role assigned to user successfully." ,
@@ -6469,9 +6476,8 @@ export function useRbacUserAssignments(options?: {
64696476 ...params
64706477 } : UserRoleAssignmentUpdate & { assignmentId : string } ) =>
64716478 await rbacUpdateUserAssignment ( { assignmentId, requestBody : params } ) ,
6472- onSuccess : ( ) => {
6473- queryClient . invalidateQueries ( { queryKey : [ "rbac-user-assignments" ] } )
6474- queryClient . invalidateQueries ( { queryKey : [ "user-scopes" ] } )
6479+ onSuccess : async ( ) => {
6480+ await invalidateAssignmentQueries ( )
64756481 toast ( {
64766482 title : "User assignment updated" ,
64776483 description : "User assignment updated successfully." ,
@@ -6512,9 +6518,8 @@ export function useRbacUserAssignments(options?: {
65126518 } = useMutation ( {
65136519 mutationFn : async ( assignmentId : string ) =>
65146520 await rbacDeleteUserAssignment ( { assignmentId } ) ,
6515- onSuccess : ( ) => {
6516- queryClient . invalidateQueries ( { queryKey : [ "rbac-user-assignments" ] } )
6517- queryClient . invalidateQueries ( { queryKey : [ "user-scopes" ] } )
6521+ onSuccess : async ( ) => {
6522+ await invalidateAssignmentQueries ( )
65186523 toast ( {
65196524 title : "User assignment deleted" ,
65206525 description : "User assignment removed successfully." ,
0 commit comments