[common/features] refactor: PageLayout menuPaths 쿼리 데이터로 수정
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user