More work to prepare the new Archives, Posts, and Recovery Meetings

This commit is contained in:
Scott Idem
2024-09-25 18:44:49 -04:00
parent 283850e917
commit 32ca117b11
15 changed files with 1272 additions and 164 deletions

View File

@@ -214,7 +214,7 @@ export async function load_ae_obj_li__event_location(
api_cfg: api_cfg,
for_obj_type: 'event_location',
for_obj_id: event_location_id,
params: {qry__enabled: 'all', qry__limit: 15},
params: {qry__enabled: enabled, qry__limit: limit},
try_cache: try_cache,
log_lvl: log_lvl
})
@@ -244,7 +244,7 @@ export async function load_ae_obj_li__event_location(
api_cfg: api_cfg,
for_obj_type: 'event_location',
for_obj_id: event_location_id,
params: {qry__enabled: 'all', qry__limit: 100},
params: {qry__enabled: enabled, qry__limit: limit},
try_cache: try_cache,
log_lvl: log_lvl
})
@@ -440,13 +440,69 @@ export async function create_ae_obj__event_location(
}
// Updated 2024-09-25
export async function update_ae_obj__event_location(
{
api_cfg,
event_location_id,
data_kv,
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
event_location_id: string,
data_kv: key_val,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
) {
if (log_lvl) {
console.log(`*** update_ae_obj__event_location() *** event_location_id=${event_location_id}`, data_kv);
}
ae_promises.update__event_location_obj = await api.update_ae_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'event_location',
obj_id: event_location_id,
fields: data_kv,
key: api_cfg.api_crud_super_key,
params: params,
return_obj: true,
log_lvl: log_lvl
})
.then(function (event_location_obj_update_result) {
if (event_location_obj_update_result) {
if (try_cache) {
db_save_ae_obj_li__event_location({
obj_type: 'event_location', obj_li: [event_location_obj_update_result]
});
}
return event_location_obj_update_result;
} else {
return null;
}
})
.catch(function (error) {
console.log('No results returned or failed.', error);
})
.finally(function () {
});
if (log_lvl) {
console.log('ae_promises.update__event_location_obj:', ae_promises.update__event_location_obj);
}
return ae_promises.update__event_location_obj;
}
// This function will loop through the event_location_obj_li and save each one to the DB.
// Updated 2024-06-25
export function db_save_ae_obj_li__event_location(
{
obj_type,
obj_li,
log_lvl=0
log_lvl = 0
}: {
obj_type: string,
obj_li: any,