Should have saved my work earlier... General clean up of initial API calls and saving to IDB. Other fixes and updates.

This commit is contained in:
Scott Idem
2024-08-07 15:26:58 -04:00
parent 0d34f81fa7
commit 7aebf24996
40 changed files with 1218 additions and 3259 deletions

View File

@@ -11,8 +11,8 @@ export async function handle_load_ae_obj_id__event_session(
{
api_cfg,
event_session_id,
try_cache=false,
log_lvl=0
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
event_session_id: string,
@@ -36,8 +36,13 @@ export async function handle_load_ae_obj_id__event_session(
})
.then(function (event_session_obj_get_result) {
if (event_session_obj_get_result) {
// This is expecting a list
handle_db_save_ae_obj_li__event_session({obj_type: 'event_session', obj_li: [event_session_obj_get_result]});
if (try_cache) {
// This is expecting a list
handle_db_save_ae_obj_li__event_session({
obj_type: 'event_session',
obj_li: [event_session_obj_get_result]
});
}
return event_session_obj_get_result;
} else {
console.log('No results returned.');
@@ -99,7 +104,12 @@ export async function handle_load_ae_obj_li__event_session(
})
.then(function (event_session_obj_li_get_result) {
if (event_session_obj_li_get_result) {
handle_db_save_ae_obj_li__event_session({obj_type: 'event_session', obj_li: event_session_obj_li_get_result});
if (try_cache) {
handle_db_save_ae_obj_li__event_session({
obj_type: 'event_session',
obj_li: event_session_obj_li_get_result
});
}
return event_session_obj_li_get_result;
} else {
return [];