Stuck and done for the night
This commit is contained in:
@@ -41,8 +41,6 @@ async function handle_load_ae_obj_id__event({api_cfg, event_id, try_cache=false}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 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}`);
|
||||
@@ -123,6 +121,68 @@ 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, params={}, try_cache=true}) {
|
||||
console.log(`*** handle_search__event_badge() *** event_id=${event_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
let limit: number = (params.qry__limit ?? 25); // 99
|
||||
let offset: number = (params.qry__offset ?? 0); // 0
|
||||
|
||||
let params_json: key_val = {};
|
||||
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) {
|
||||
params_json['ft_qry'] = {
|
||||
'default_qry_str': fulltext_search_qry_str,
|
||||
// 'location_address_json_ext': fulltext_search_qry_str, // JSON extracted text DB field
|
||||
// 'contact_li_json_ext': fulltext_search_qry_str, // JSON extracted text DB field
|
||||
};
|
||||
}
|
||||
|
||||
// $events_sess.badges.status_qry__search = 'loading';
|
||||
ae_promises.search__event_badge = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_badge',
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_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.
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
// order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'created_on': 'DESC', 'updated_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: 1
|
||||
})
|
||||
|
||||
.then(function (badge_obj_li_get_result) {
|
||||
// console.log('Badge list:', badge_obj_li_get_result);
|
||||
if (badge_obj_li_get_result) {
|
||||
// $slct.badge_obj_li = badge_obj_li_get_result;
|
||||
handle_db_save_ae_obj_li__badge({obj_type: 'event_badge', obj_li: badge_obj_li_get_result});
|
||||
return badge_obj_li_get_result;
|
||||
} else {
|
||||
// $slct.badge_obj_li = [];
|
||||
return [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
})
|
||||
.finally(function () {
|
||||
// $events_sess.badges.status_qry__search = 'done';
|
||||
|
||||
// console.log('Badge list:', badge_obj_li_get_result);
|
||||
// return badge_obj_li_get_result;
|
||||
});
|
||||
|
||||
console.log('ae_promises.search__event_badge:', ae_promises.search__event_badge);
|
||||
return ae_promises.search__event_badge;
|
||||
}
|
||||
|
||||
async function handle_load_ae_obj_id__exhibit({api_cfg, exhibit_id, try_cache=false}) {
|
||||
console.log(`*** handle_load_ae_obj_id__exhibit() *** exhibit_id=${exhibit_id}`);
|
||||
|
||||
@@ -532,6 +592,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_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,
|
||||
handle_load_ae_obj_li__exhibit: handle_load_ae_obj_li__exhibit,
|
||||
handle_load_ae_obj_li__exhibit_tracking: handle_load_ae_obj_li__exhibit_tracking,
|
||||
|
||||
Reference in New Issue
Block a user