Separating out components and functions to make things more modular.

This commit is contained in:
Scott Idem
2024-07-03 17:48:06 -04:00
parent 270a1429f8
commit 4aae2bead4
16 changed files with 528 additions and 119 deletions

View File

@@ -51,23 +51,32 @@ export async function handle_load_ae_obj_id__event_file(
}
// Updated 2024-06-14
// Updated 2024-07-03
export async function handle_load_ae_obj_li__event_file(
{
api_cfg,
event_session_id,
for_obj_type,
for_obj_id,
params={},
try_cache=true,
log_lvl=0
}: {
api_cfg: any,
event_session_id: string,
for_obj_type: string,
for_obj_id: string,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
) {
console.log(`*** handle_load_ae_obj_li__event_file() *** event_id=${event_session_id}`);
console.log(`*** handle_load_ae_obj_li__event_file() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
// Check if for_obj_type is in the list of valid Aether object types:
let valid_for_obj_types = ['event', 'event_session', 'event_presentation', 'event_presenter', 'event_location'];
if (!valid_for_obj_types.includes(for_obj_type)) {
console.log(`Invalid for_obj_type: ${for_obj_type}`);
return [];
}
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
@@ -81,8 +90,8 @@ export async function handle_load_ae_obj_li__event_file(
ae_promises.load__event_file_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'event_file',
for_obj_type: 'event_session',
for_obj_id: event_session_id,
for_obj_type: for_obj_type,
for_obj_id: for_obj_id,
use_alt_table: true, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
enabled: enabled,