22 lines
660 B
TypeScript
22 lines
660 B
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
import type { MenuInfo, MenuRole, MenuService } from "../model/menu-interface";
|
|
|
|
export class MenuApiService implements MenuService {
|
|
async getMenuRoles(siteId: string): Promise<MenuRole[]> {
|
|
const response = await client.get<MenuRole[]>(
|
|
`${ENDPOINT.CMS_SERVICE.MENU_ROLES}/${siteId}`,
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
async getMenuInfo(menuCd: string): Promise<MenuInfo> {
|
|
const response = await client.get<MenuInfo>(
|
|
`${ENDPOINT.CMS_SERVICE.MENUS}/${menuCd}`,
|
|
);
|
|
return response.data;
|
|
}
|
|
}
|
|
|
|
export const MenuApi = new MenuApiService();
|