fix(pres-mgmt): inject event_id into nested presenter/presentation creates

v_event_presenter and v_event_presentation both use INNER JOIN with event
on event_id. Without event_id in the payload the view returns 0 rows after
INSERT, the API falls back to a minimal response, and Dexie save fails
with "Object is missing a valid ID". Pull event_id (and event_session_id
for presenters) from events_slct at creation time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-17 11:09:00 -04:00
parent 4c148206ac
commit abb9e94ce1
2 changed files with 20 additions and 2 deletions

View File

@@ -323,12 +323,21 @@ export async function create_ae_obj__event_presenter({
);
return null;
}
// event_id and event_session_id are required for the v_event_presenter view
// (which uses INNER JOIN with event on event_id). Without them the API cannot
// return the full object after creation and the Dexie save fails.
const ev_slct = get(events_slct);
const fields_with_ids = {
event_id: ev_slct.event_id ?? undefined,
event_session_id: ev_slct.event_session_id ?? undefined,
...data_kv
};
const result = await api.create_nested_obj({
api_cfg,
for_obj_type: 'event_presentation',
for_obj_id: event_presentation_id,
obj_type: 'event_presenter',
fields: { ...data_kv },
fields: fields_with_ids,
log_lvl
});