create role

This commit is contained in:
hamid zarghami
2025-11-16 15:20:20 +03:30
parent af2556503e
commit 63e9a80bb6
3 changed files with 90 additions and 0 deletions
+10
View File
@@ -17,3 +17,13 @@ export const useDeleteRole = () => {
},
});
};
export const useCreateRole = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: api.createRole,
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["roles"] });
},
});
};