All files / src/features/Permissions/ModalV2/hooks useDeletePermission.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13      4x 306x 1x       306x      
import { updateUserPermissions } from "@services/api/accessControl/accessControl";
import { useMutation } from "react-query";
 
const useDeletePermission = (accountId: number, memberId: number) => {
  const request = async (permissionID: string) => {
    return updateUserPermissions(accountId, memberId, {
      detach: [permissionID],
    })
  };
  return useMutation(request);
}
 
export default useDeletePermission;