add adminns

This commit is contained in:
hamid zarghami
2025-12-30 10:32:28 +03:30
parent 342326432d
commit bc61ea6a20
6 changed files with 307 additions and 38 deletions
+30 -1
View File
@@ -1,6 +1,10 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/IconService";
import { GroupIconsResponse, ReportsResponse } from "../types/Types";
import {
GroupIconsResponse,
ReportsResponse,
SystemRolesResponse,
} from "../types/Types";
export const useGetIcons = () => {
return useQuery({
@@ -68,3 +72,28 @@ export const useGetRestaurantSmsCount = () => {
queryFn: api.getRestaurantSmsCount,
});
};
export const useDeleteRestaurantAdmin = () => {
return useMutation({
mutationFn: ({
restaurantId,
adminId,
}: {
restaurantId: string;
adminId: string;
}) => api.deleteRestaurantAdmin(restaurantId, adminId),
});
};
export const useAddAdminRestaurant = () => {
return useMutation({
mutationFn: api.addAdminRestaurant,
});
};
export const useGetSystemRoles = () => {
return useQuery<SystemRolesResponse>({
queryKey: ["system-roles"],
queryFn: api.getSystemRoles,
});
};