General work through out the day. Lots of interruptions from the dogs.

This commit is contained in:
Scott Idem
2024-03-25 19:26:49 -04:00
parent b0f2e2ccdf
commit 3ddef770c0
16 changed files with 497 additions and 491 deletions

View File

@@ -41,6 +41,39 @@ async function handle_load_ae_obj_id__event({api_cfg, event_id, try_cache=false}
}
async function handle_load_ae_obj_id__badge({api_cfg, badge_id, try_cache=false}) {
console.log(`*** handle_load_ae_obj_id__badge() *** badge_id=${badge_id}`);
let params = {};
// $events_sess.badges.status_load__badge_obj = 'loading';
ae_promises.load__badge_obj = await api.get_ae_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'event_badge',
obj_id: badge_id, // NOTE: This is the FQDN, not normally the ID.
use_alt_table: false, // 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 in the API config.
params: params,
log_lvl: 0
})
.then(function (badge_obj_get_result) {
if (badge_obj_get_result) {
// This is expecting a list
handle_db_save_ae_obj_li__badge({obj_type: 'event_badge', obj_li: [badge_obj_get_result]});
return badge_obj_get_result;
} else {
console.log('No results returned.');
return null;
}
})
.catch(function (error) {
console.log('No results returned or failed.', error);
});
return ae_promises.load__badge_obj;
}
// Updated 2024-03-06
async function handle_load_ae_obj_li__badge({api_cfg, event_id, params={}, try_cache=true}: {api_cfg: any, event_id: any, params: any, try_cache?: boolean}) {
console.log(`*** handle_load_ae_obj_li__badge() *** event_id=${event_id}`);
@@ -121,7 +154,6 @@ async function handle_load_ae_obj_li__badge({api_cfg, event_id, params={}, try_c
}
async function handle_search__event_badge({api_cfg, event_id, fulltext_search_qry_str, external_event_id, params={}, try_cache=true}) {
console.log(`*** handle_search__event_badge() *** event_id=${event_id}`);
@@ -476,6 +508,10 @@ async function handle_create_ae_obj__exhibit_tracking({api_cfg, exhibit_id, even
}
// This function will loop through the badge_obj_li and save each one to the DB.
function handle_db_save_ae_obj_li__badge({obj_type, obj_li}) {
console.log(`*** handle_db_save_ae_obj_li__badge() ***`);
@@ -544,7 +580,7 @@ function handle_db_save_ae_obj_li__badge({obj_type, obj_li}) {
created_on: obj.created_on,
updated_on: obj.updated_on,
});
console.log(`Put obj with ID: ${obj.event_badge_id_random} or ${id_random}`);
// console.log(`Put obj with ID: ${obj.event_badge_id_random} or ${id_random}`);
} catch (error) {
let status = `Failed to put ${obj.event_badge_id_random}: ${error}`;
console.log(status);
@@ -666,7 +702,7 @@ function handle_db_save_ae_obj_li__exhibitor_tracking({obj_type, obj_li}) {
created_on: obj.created_on,
updated_on: obj.updated_on,
});
console.log(`Put obj with ID: ${obj.event_exhibit_tracking_id_random} or ${id_random}`);
// console.log(`Put obj with ID: ${obj.event_exhibit_tracking_id_random} or ${id_random}`);
} catch (error) {
let status = `Failed to put ${obj.event_exhibit_tracking_id_random}: ${error}`;
console.log(status);
@@ -683,6 +719,7 @@ function handle_db_save_ae_obj_li__exhibitor_tracking({obj_type, obj_li}) {
let export_obj = {
handle_load_ae_obj_id__event: handle_load_ae_obj_id__event,
handle_load_ae_obj_id__badge: handle_load_ae_obj_id__badge,
handle_load_ae_obj_li__badge: handle_load_ae_obj_li__badge,
handle_search__event_badge: handle_search__event_badge,
handle_load_ae_obj_id__exhibit: handle_load_ae_obj_id__exhibit,