add adminns
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user