Add re-analyse button and POST /documents/{id}/reprocess endpoint

Resets status to pending, clears error_message, and re-enqueues the
background AI extraction task. Button is disabled while the document
is already pending or processing; returns 409 in that case from the API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-04-17 17:00:17 +02:00
parent 7d0edbd5e7
commit d2042153a7
5 changed files with 59 additions and 1 deletions
+3
View File
@@ -170,6 +170,9 @@ export const updateDocumentTags = (id: string, tags: string[]) =>
export const updateDocumentTitle = (id: string, title: string) =>
api.patch<DocumentOut>(`/documents/${id}/title`, { title }).then((r) => r.data);
export const reprocessDocument = (id: string) =>
api.post<DocumentOut>(`/documents/${id}/reprocess`).then((r) => r.data);
export const assignCategory = (docId: string, catId: string) =>
api.post(`/documents/${docId}/categories/${catId}`);