docmost/apps/client/src/features/page-history/services/page-history-service.ts
2024-01-09 18:58:26 +01:00

13 lines
503 B
TypeScript

import api from '@/lib/api-client';
import { IPageHistory } from '@/features/page-history/types/page.types';
export async function getPageHistoryList(pageId: string): Promise<IPageHistory[]> {
const req = await api.post<IPageHistory[]>('/pages/history', { pageId });
return req.data as IPageHistory[];
}
export async function getPageHistoryById(id: string): Promise<IPageHistory> {
const req = await api.post<IPageHistory>('/pages/history/details', { id });
return req.data as IPageHistory;
}