refactor: Paperless-Dokumentrouten unter /api/paperless/documents/:id
„inbox“ war doppelt belegt (/api/inbox = Scanner, /api/paperless/inbox = Paperless-Posteingang) und passte nicht zur Manuell-Seite, die dieselben Routen nutzt. Umbenannt (ohne Alias, nur das eigene Frontend nutzt sie): PUT paperless/inbox/:id → PUT paperless/documents/:id GET paperless/inbox/pdf/:id → GET paperless/documents/:id/pdf GET paperless/inbox/preview/:id → GET paperless/documents/:id/preview GET paperless/inbox/:id/erechnung → GET paperless/documents/:id/erechnung Dabei: - Dokumentsuche (GET documents) wieder für den Posteingang (VIEW_INBOX) statt nur Admin – die Verknüpfungssuche im Bearbeiten-Dialog nutzt sie; die Einschränkung aus dem vorigen Commit hatte sie gebrochen. - Suche und GET documents/:id liefern nur noch id, Titel, ASN, Datum (kein OCR-Volltext, keine Statusfelder). - documents/:id/pdf auch für VIEW_SCANNER (Duplikatvergleich im Scanner). - E-Rechnungs-Vorschlag prüft wie das Speichern pro Dokument (Tag 1 bzw. Manuell-Tag); Vorschau/PDF bewusst nicht (Suchergebnisse, Duplikate). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
04fca933ee
commit
e0a6598b35
9 files changed
+138
-53
No files matched your search
@@ -81,7 +81,7 @@ export const paperlessApi = {
|
||||
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),
|
||||
api.get<Blob>(`/api/paperless/documents/${id}/pdf`, { responseType: 'blob' }).then(r => r.data),
|
||||
pruefeBelegnummer: (belegnummer: string) =>
|
||||
api.get<BelegnummerPruefung>('/api/paperless/belegnummer-pruefung', { params: { belegnummer } }).then(r => r.data),
|
||||
};
|
||||
@@ -64,7 +64,7 @@ export const posteingangApi = {
|
||||
.then((r) => r.data),
|
||||
|
||||
updateDocument: (id: number, data: any) =>
|
||||
api.put(`/api/paperless/inbox/${id}`, data).then((r) => r.data),
|
||||
api.put(`/api/paperless/documents/${id}`, data).then((r) => r.data),
|
||||
|
||||
getKontonummern: (correspondentId: number) =>
|
||||
api.get<Kontonummer[]>(`/api/kontonummern/FromCorrespondent/${correspondentId}`).then(r => r.data),
|
||||
@@ -73,5 +73,5 @@ export const posteingangApi = {
|
||||
api.post<Kontonummer>('/api/kontonummern', data).then(r => r.data),
|
||||
|
||||
getErechnung: (id: number) =>
|
||||
api.get<ERechnungVorschlag>(`/api/paperless/inbox/${id}/erechnung`).then(r => r.data),
|
||||
api.get<ERechnungVorschlag>(`/api/paperless/documents/${id}/erechnung`).then(r => r.data),
|
||||
};
|
||||
@@ -634,7 +634,7 @@ export default function DocumentEditModal({ documentId, document, open, onClose,
|
||||
icon={<EyeOutlined />}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
openAuthUrl(`${getEnv('VITE_API_URL')}/api/paperless/inbox/pdf/${currentId}`);
|
||||
openAuthUrl(`${getEnv('VITE_API_URL')}/api/paperless/documents/${currentId}/pdf`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -679,13 +679,13 @@ export default function DocumentEditModal({ documentId, document, open, onClose,
|
||||
icon={<ExportOutlined />}
|
||||
block
|
||||
style={{ marginBottom: 8 }}
|
||||
onClick={() => openAuthUrl(`${getEnv('VITE_API_URL')}/api/paperless/inbox/pdf/${documentId}`)}
|
||||
onClick={() => openAuthUrl(`${getEnv('VITE_API_URL')}/api/paperless/documents/${documentId}/pdf`)}
|
||||
>
|
||||
PDF in neuem Tab öffnen
|
||||
</Button>
|
||||
)}
|
||||
<AuthIframe
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/pdf/${documentId}#toolbar=0`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${documentId}/pdf#toolbar=0`}
|
||||
style={{ width: '100%', height: isMobile ? '50vh' : '100%' }}
|
||||
title="PDF Preview"
|
||||
/>
|
||||
|
||||
@@ -90,7 +90,7 @@ export default function DocumentSearchModal({ open, onCancel, onSelect }: Props)
|
||||
<List.Item.Meta
|
||||
avatar={
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${doc.id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${doc.id}/preview`}
|
||||
width={80}
|
||||
height={110}
|
||||
style={{ objectFit: 'cover', borderRadius: 4, border: '1px solid #f0f0f0' }}
|
||||
|
||||
@@ -75,7 +75,7 @@ export default function ManuellBearbeitenPage() {
|
||||
|
||||
const popoverContent = (id: number) => (
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${id}/preview`}
|
||||
width={400}
|
||||
/>
|
||||
);
|
||||
@@ -108,7 +108,7 @@ export default function ManuellBearbeitenPage() {
|
||||
render: (_: any, record: PosteingangDocument) => (
|
||||
<Popover content={popoverContent(record.id)} placement="right" trigger="hover">
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${record.id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${record.id}/preview`}
|
||||
width={100}
|
||||
style={{ border: '1px solid #d9d9d9', objectFit: 'contain' }}
|
||||
/>
|
||||
@@ -172,7 +172,7 @@ export default function ManuellBearbeitenPage() {
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
<div style={{ display: 'flex', gap: 12 }}>
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${record.id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${record.id}/preview`}
|
||||
width={72}
|
||||
style={{ border: '1px solid #d9d9d9', objectFit: 'contain', flexShrink: 0 }}
|
||||
/>
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function PosteingangPage() {
|
||||
|
||||
const popoverContent = (id: number) => (
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${id}/preview`}
|
||||
width={400}
|
||||
/>
|
||||
);
|
||||
@@ -80,7 +80,7 @@ export default function PosteingangPage() {
|
||||
render: (_: any, record: PosteingangDocument) => (
|
||||
<Popover content={popoverContent(record.id)} placement="right" trigger="hover">
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${record.id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${record.id}/preview`}
|
||||
width={100}
|
||||
style={{ border: '1px solid #d9d9d9', objectFit: 'contain' }}
|
||||
/>
|
||||
@@ -136,7 +136,7 @@ export default function PosteingangPage() {
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
<div style={{ display: 'flex', gap: 12 }}>
|
||||
<AuthImage
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${record.id}`}
|
||||
src={`${getEnv('VITE_API_URL')}/api/paperless/documents/${record.id}/preview`}
|
||||
width={72}
|
||||
style={{ border: '1px solid #d9d9d9', objectFit: 'contain', flexShrink: 0 }}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user