ux(transcription): show error banner when bulk mark-all-reviewed fails #627

Merged
marcel merged 15 commits from feat/issue-356-mark-all-reviewed-error into main 2026-05-19 22:09:02 +02:00
Showing only changes of commit e3e8373526 - Show all commits

View File

@@ -119,7 +119,11 @@ export function createTranscriptionBlocks(
const res = await fetchImpl(`/api/documents/${documentId()}/transcription-blocks/review-all`, {
method: 'PUT'
});
if (!res.ok) return;
if (!res.ok) {
const body = await res.json().catch(() => ({}));
// Never render body.message — route through getErrorMessage() to prevent leaking backend internals
throw new Error((body as { code?: string })?.code ?? 'INTERNAL_ERROR');
}
const updated = (await res.json()) as { id: string; reviewed: boolean }[];
for (const b of updated) {
const existing = blocks.find((x) => x.id === b.id);