import axios from 'axios'; export interface SyncBlockDto { id: string; workspaceId: string; content: Record; createdBy: string; createdAt: string; updatedAt: string; } export interface SyncBlockUsageDto { pageId: string; pageTitle: string | null; slugId: string; spaceId: string; workspaceId: string; } const BASE = '/api/v1/sync-blocks'; export const syncBlocksClient = { create(content: Record = {}): Promise { return axios.post(BASE, { content }).then((r) => r.data); }, get(id: string): Promise { return axios.get(`${BASE}/${id}`).then((r) => r.data); }, update(id: string, content: Record): Promise { return axios.patch(`${BASE}/${id}`, { content }).then((r) => r.data); }, delete(id: string): Promise { return axios.delete(`${BASE}/${id}`).then(() => undefined); }, usages(id: string): Promise { return axios.get(`${BASE}/${id}/usages`).then((r) => r.data); }, };