Files
frontend/apps/cs/src/pages/menu/api/menu-history-service.ts
T

29 lines
829 B
TypeScript

import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type { PageableList } from "@/shared/model";
import type {
MenuHistory,
MenuHistorySearchParams,
MenuHistoryService,
} from "../model/menu-history-interface";
export class MenuHistoryApiService implements MenuHistoryService {
public async getMenuHistoryList(
params: MenuHistorySearchParams,
): Promise<PageableList<MenuHistory>> {
const response = await client.get<PageableList<MenuHistory>>(
`${ENDPOINT.CMS_SERVICE.MENU_HISTORY}`,
{ params },
);
return response.data;
}
public async rollbackMenu(hstrySn: number): Promise<void> {
await client.post(`${ENDPOINT.CMS_SERVICE.MENU_HISTORY}/rollback`, {
hstrySn,
});
}
}
export const MenuHistoryApi = new MenuHistoryApiService();