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:
@@ -11,8 +11,8 @@ export async function handle_load_ae_obj_id__event(
|
||||
{
|
||||
api_cfg,
|
||||
event_id,
|
||||
try_cache=false,
|
||||
log_lvl=0
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_id: string,
|
||||
@@ -36,7 +36,13 @@ export async function handle_load_ae_obj_id__event(
|
||||
})
|
||||
.then(function (event_obj_get_result) {
|
||||
if (event_obj_get_result) {
|
||||
handle_db_save_ae_obj_li__event({obj_type: 'event', obj_li: [event_obj_get_result]});
|
||||
if (try_cache) {
|
||||
// This is expecting a list
|
||||
handle_db_save_ae_obj_li__event({
|
||||
obj_type: 'event',
|
||||
obj_li: [event_obj_get_result]
|
||||
});
|
||||
}
|
||||
return event_obj_get_result;
|
||||
} else {
|
||||
console.log('No results returned.');
|
||||
@@ -97,7 +103,9 @@ export async function handle_load_ae_obj_li__event(
|
||||
})
|
||||
.then(function (event_obj_li_get_result) {
|
||||
if (event_obj_li_get_result) {
|
||||
handle_db_save_ae_obj_li__event({obj_type: 'event', obj_li: event_obj_li_get_result});
|
||||
if (try_cache) {
|
||||
handle_db_save_ae_obj_li__event({obj_type: 'event', obj_li: event_obj_li_get_result});
|
||||
}
|
||||
return event_obj_li_get_result;
|
||||
} else {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user