[common/features] refactor: PageLayout menuPaths 쿼리 데이터로 수정

This commit is contained in:
2025-07-01 16:49:54 +09:00
parent 0dad2a0e50
commit de0958acbe
5 changed files with 52 additions and 18 deletions
@@ -1,14 +1,21 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type { MenuItem, MenuService } from "../model/menu-interface";
import type { MenuInfo, MenuRole, MenuService } from "../model/menu-interface";
export class MenuApiService implements MenuService {
async getMenuRoles(siteId: string): Promise<MenuItem[]> {
const response = await client.get<MenuItem[]>(
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();