mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
Merge pull request #148 from ArnasDon/fix/template-header-none-sentinel
fix(templates): map "None" header sentinel to null before save
This commit is contained in:
commit
3b0d841533
@ -405,7 +405,15 @@ export function TemplateManager() {
|
||||
<Label className="text-slate-300">Header Type</Label>
|
||||
<Select
|
||||
value={form.header_type}
|
||||
onValueChange={(val) => setForm({ ...form, header_type: val || '' })}
|
||||
onValueChange={(val) =>
|
||||
// "none" is a sentinel (the Select disallows value="")
|
||||
// — normalize it back to empty string so the DB CHECK
|
||||
// constraint (text|image|video|document) doesn't reject it.
|
||||
setForm({
|
||||
...form,
|
||||
header_type: !val || val === 'none' ? '' : val,
|
||||
})
|
||||
}
|
||||
>
|
||||
<SelectTrigger className="w-full bg-slate-800 border-slate-700 text-white">
|
||||
<SelectValue placeholder="None" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user