Fixed Form Vlidation
This commit is contained in:
@@ -52,5 +52,11 @@ export const humanize = (key: string) =>
|
||||
.map((word) => (ACRONYMS.has(word) ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1)))
|
||||
.join(" ");
|
||||
|
||||
/** Column labels that read wrong once spelled out from their key. The stored column is still
|
||||
* "aug_sales" (the printed form's own field, matching the database and the PDF) — this is only
|
||||
* what the app displays, since "Aug Sales" is misleading once the row can be any month. */
|
||||
const COLUMN_LABEL_OVERRIDES: Record<string, string> = { aug_sales: "Month Sales" };
|
||||
export const columnLabel = (key: string) => COLUMN_LABEL_OVERRIDES[key] ?? humanize(key);
|
||||
|
||||
export const errorMessage = (error: unknown, fallback = "Something went wrong") =>
|
||||
error instanceof Error ? error.message : fallback;
|
||||
|
||||
Reference in New Issue
Block a user