Create presentations and presenters. Making things look nicer.
This commit is contained in:
@@ -113,6 +113,64 @@ export async function handle_load_ae_obj_li__event_presentation(
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-24
|
||||
export async function handle_create_ae_obj__event_presentation(
|
||||
{
|
||||
api_cfg,
|
||||
event_id,
|
||||
event_session_id,
|
||||
data_kv,
|
||||
params={},
|
||||
log_lvl=0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_id: string,
|
||||
event_session_id: string,
|
||||
data_kv: key_val,
|
||||
params?: key_val,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** handle_create_ae_obj__event_presentation() *** event_id=${event_id} event_session_id=${event_session_id}`);
|
||||
|
||||
ae_promises.create__event_presentation = await api.create_ae_obj_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_presentation',
|
||||
fields: {
|
||||
event_id_random: event_id,
|
||||
event_session_id_random: event_session_id,
|
||||
...data_kv
|
||||
},
|
||||
key: api_cfg.api_crud_super_key,
|
||||
params: params,
|
||||
return_obj: true,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then(function (event_presentation_obj_create_result) {
|
||||
if (event_presentation_obj_create_result) {
|
||||
handle_db_save_ae_obj_li__event_presentation(
|
||||
{
|
||||
obj_type: 'event_presentation',
|
||||
obj_li: [event_presentation_obj_create_result]
|
||||
});
|
||||
return event_presentation_obj_create_result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
})
|
||||
.finally(function () {
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.create__event_presentation:', ae_promises.create__event_presentation);
|
||||
}
|
||||
return ae_promises.create__event_presentation;
|
||||
}
|
||||
|
||||
|
||||
// This function will loop through the event_presentation_obj_li and save each one to the DB.
|
||||
// Updated 2024-06-10
|
||||
export function handle_db_save_ae_obj_li__event_presentation(
|
||||
|
||||
Reference in New Issue
Block a user