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
+25
View File
@@ -7,6 +7,8 @@ import {
ReportsResponse,
RestaurantsResponse,
RestaurantSmsCountResponse,
AddAdminRestaurantType,
SystemRolesResponse,
} from "../types/Types";
export const getIcons = async (): Promise<IconsResponse> => {
@@ -62,3 +64,26 @@ export const getRestaurantSmsCount = async (): Promise<
const { data } = await axios.get(`/admin/dmenu/restaurants/sms-count`);
return data;
};
export const deleteRestaurantAdmin = async (
restaurantId: string,
adminId: string
) => {
const { data } = await axios.delete(
`/admin/dmenu/restaurants/${restaurantId}/admins/${adminId}`
);
return data;
};
export const addAdminRestaurant = async (params: AddAdminRestaurantType) => {
const { data } = await axios.post(
`/admin/dmenu/restaurants/${params.restaurantId}/admins`,
params
);
return data;
};
export const getSystemRoles = async (): Promise<SystemRolesResponse> => {
const { data } = await axios.get(`/admin/dmenu/system-roles`);
return data;
};