fix(events): Fix pres mgmt reports data loading and field mapping

- Fix session detail page params not being passed to component (causing undefined session_id)
- Fix wrapper components discarding API enriched data by re-fetching from IDB
- Fix event_file, event_session, event_presenter wrappers to preserve API data
- Add optional chaining for hash_sha256 field to prevent undefined crashes
- Fix search__event_file to always process API results before returning
- Ensures hosted_file_size -> file_size field mapping for reports
- All pres mgmt reports (files, sessions, presenters) now work on cold-start
This commit is contained in:
Scott Idem
2026-02-26 14:36:46 -05:00
parent 61025ea0d5
commit 9547da6da6
6 changed files with 72 additions and 84 deletions

View File

@@ -440,20 +440,29 @@ export async function search__event_file({
params: { inc_hosted_file },
log_lvl
});
if (result_li && try_cache) {
// CRITICAL: Always process the results to map hosted_file_size → file_size
// and other field mappings for UI consistency
if (result_li) {
const processed = await process_ae_obj__event_file_props({
obj_li: result_li,
log_lvl
});
await db_save_ae_obj_li__ae_obj({
db_instance: db_events,
table_name: 'file',
obj_li: processed,
properties_to_save,
log_lvl
});
if (try_cache) {
await db_save_ae_obj_li__ae_obj({
db_instance: db_events,
table_name: 'file',
obj_li: processed,
properties_to_save,
log_lvl
});
}
return processed; // Return processed data with mapped fields
}
return result_li || [];
return [];
}
export const qry__event_file = search__event_file;