fix(badges): send event_badge_template_id_random on badge create

The IDB stores the random string in event_badge_template_id (overwritten
by _process_generic_props). Sending this as event_badge_template_id
passed a string to an int(11) FK column — backend silently ignored it.
Using event_badge_template_id_random lets the V3 CRUD handler resolve
it to the correct integer FK.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-11 18:34:54 -04:00
parent d35a28f912
commit 5e07f2822c

View File

@@ -118,7 +118,9 @@ async function handle_submit(event: Event) {
try {
const badge_data: key_val = {
event_person_id,
event_badge_template_id: selected_template_id || null,
// selected_template_id holds the random string (IDB stores _random overwritten into _id
// by _process_generic_props). The backend resolves _random fields to the integer FK.
event_badge_template_id_random: selected_template_id || null,
given_name,
family_name,
email: email || null,