From 266e487ac85813a182b1d66b13ba365def089556 Mon Sep 17 00:00:00 2001 From: Arnas Donauskas Date: Fri, 29 May 2026 11:45:59 +0200 Subject: [PATCH] fix(templates): map "None" header sentinel to null before save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header type Select uses value="none" as a sentinel (Radix disallows value=""), but the Save handler passed it through verbatim to Supabase. The DB CHECK constraint on message_templates.header_type only allows text|image|video|document, so picking "None" raised a constraint violation and the template never saved. Normalize "none" (and any falsy value) to '' at the input boundary so form.header_type is always either '' (→ null on save) or a valid type. Closes #147 (the header-dropdown half — Meta submission is tracked separately). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/settings/template-manager.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/settings/template-manager.tsx b/src/components/settings/template-manager.tsx index e3fb6fb..46d6751 100644 --- a/src/components/settings/template-manager.tsx +++ b/src/components/settings/template-manager.tsx @@ -405,7 +405,15 @@ export function TemplateManager() {