29 lines
829 B
TypeScript
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();
|