import api from './client'; export interface FreigabeDocument { id: number; title: string; created: string; created_date: string; correspondent: number | null; document_type: number | null; archive_serial_number: number | null; tags: number[]; custom_fields: { field: number; value: any }[]; } export interface FreigabeOption { id: string; label: string; } export interface FreigabeResult { count: number; results: FreigabeDocument[]; } export const freigabeApi = { getDocuments: (page = 1, pageSize = 25, nurNichtFreigegeben = true) => api .get('/api/freigabe/documents', { params: { page, pageSize, nurNichtFreigegeben }, }) .then((r) => r.data), setFreigabe: (docId: number, value: string | null) => api .put<{ success: boolean }>(`/api/freigabe/documents/${docId}/freigabe`, { value }) .then((r) => r.data), getOptions: () => api.get('/api/freigabe/options').then((r) => r.data), };