Files
paperlessmanager/paperless-frontend/src/api/paperless.ts
T
bjoernpoettker d96e06e86d
Build and Push Multi-Platform Images / build-and-push (push) Successful in 38s
feat: add Steuertags concept to separate workflow from content tags
- New steuertag_ids setting to mark tags as workflow-only (not editable)
- DocumentEditModal shows only content tags (non-Steuertags) as editable chips
- Backend preserves Steuertags when saving document tag changes
- ManuellBearbeitenPage renders content tag chips under document title
- New Steuertags settings tab with multi-select and color preview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 11:46:39 +02:00

66 lines
2.2 KiB
TypeScript

import api from './client';
export interface PaperlessTag {
id: number;
slug: string;
name: string;
color: string;
text_color: string;
match: string;
matching_algorithm: number;
is_insensitive: boolean;
is_inbox_tag: boolean;
document_count: number;
}
export interface PaperlessDocType {
id: number;
slug: string;
name: string;
match: string;
matching_algorithm: number;
is_insensitive: boolean;
document_count: number;
}
export interface PaperlessCustomField {
id: number;
name: string;
data_type: string;
extra_data?: any;
}
export interface PaperlessCorrespondent {
id: number;
slug: string;
name: string;
match: string;
matching_algorithm: number;
is_insensitive: boolean;
document_count: number;
}
export interface PaperlessUser {
id: number;
username: string;
first_name?: string;
last_name?: string;
}
export const paperlessApi = {
getTags: () => api.get<PaperlessTag[]>('/api/paperless/tags').then(r => r.data),
getSteuertagIds: () => api.get<{ ids: number[] }>('/api/paperless/steuertags').then(r => r.data.ids),
getDocumentTypes: () => api.get<PaperlessDocType[]>('/api/paperless/document-types').then(r => r.data),
getCustomFields: () => api.get<PaperlessCustomField[]>('/api/paperless/custom-fields').then(r => r.data),
getCorrespondents: (search?: string) => api.get<PaperlessCorrespondent[]>('/api/paperless/correspondents', { params: { search } }).then(r => r.data),
getCorrespondent: (id: number) => api.get<PaperlessCorrespondent>(`/api/paperless/correspondents/${id}`).then(r => r.data),
getUsers: () => api.get<PaperlessUser[]>('/api/paperless/users').then(r => r.data),
searchDocuments: (params: { search?: string, page?: number, pageSize?: number }) =>
api.get<{ results: any[], count: number }>('/api/paperless/documents', { params }).then(r => r.data),
getDocument: (id: number) => api.get<any>(`/api/paperless/documents/${id}`).then(r => r.data),
checksumExists: (checksum: string) =>
api.post<{ exists: boolean }>('/api/paperless/checksum', { checksum }).then(r => r.data.exists),
getDocumentPdfBlob: (id: number) =>
api.get<Blob>(`/api/paperless/inbox/pdf/${id}`, { responseType: 'blob' }).then(r => r.data),
};