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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user