diff --git a/src/lib/services/catalog-repair.ts b/src/lib/services/catalog-repair.ts index 19c1581573..6e4fc372ea 100644 --- a/src/lib/services/catalog-repair.ts +++ b/src/lib/services/catalog-repair.ts @@ -506,12 +506,14 @@ export async function organizeCatalogAll(): Promise { const base = classname.split("*")[0]; return (base && furnilineByClass.get(base)) || ""; }; + // The `caption_save` column is varchar(25). The line prefix `imp_line_` + // takes 9 chars, so the slug may be at most 16 chars to stay within limit. const slug = (value: string): string => value .toLowerCase() .replace(/[^a-z0-9]+/g, "_") .replace(/^_+|_+$/g, "") - .slice(0, 40); + .slice(0, 16); // Minimum number of items a furniture line must have before it gets its own // dedicated catalog page. Lines below this threshold (one-off customs, etc.)