Files
minstrel/web/src/lib/api/error-copy.ts
T
bvandeusen c3be0f3e6e refactor(web): consolidate error-copy table to JSON source of truth
Three admin pages had divergent inline error-code → user-copy switch
tables (with wording drift, including a stale "Settings → Integrations"
that should have been Admin). Consolidate into web/src/lib/styles/error-copy.json,
expose via web/src/lib/api/error-copy.ts (ERROR_COPY + copyForCode),
and refactor the three pages to import the helper.

Fixes the three-way drift; the only user-visible behavior change is
the quarantine page now correctly says "Admin → Integrations".

Sets up the JSON for the M7 Flutter client (#356) to consume the same
table.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:01:46 -04:00

9 lines
348 B
TypeScript

import errorCopyJson from '../styles/error-copy.json';
export const ERROR_COPY: Readonly<Record<string, string>> = errorCopyJson;
export function copyForCode(code: string | null | undefined): string {
if (!code) return ERROR_COPY.unknown ?? 'Something went wrong.';
return ERROR_COPY[code] ?? ERROR_COPY.unknown ?? 'Something went wrong.';
}