Getting the badge search really ready

This commit is contained in:
2024-04-08 19:12:44 -04:00
parent 9eee2a928b
commit ef583e1328
8 changed files with 181 additions and 25 deletions

View File

@@ -191,6 +191,11 @@ async function handle_search__event_badge(
let params_json: key_val = {};
if (!fulltext_search_qry_str && !like_search_qry_str) {
console.log('No search string provided!!!');
return false; // Returning false instead of [] because no search was performed.
}
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) {
params_json['ft_qry'] = {
'default_qry_str': fulltext_search_qry_str,
@@ -227,7 +232,7 @@ async function handle_search__event_badge(
params_json['and_qry']['badge_type_code'] = type_code;
}
let order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'family_name': 'ASC', 'given_name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'};
let order_by_li = {'print_count': 'ASC', 'priority': 'DESC', 'sort': 'DESC', 'given_name': 'ASC', 'family_name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'};
// $events_sess.badges.status_qry__search = 'loading';
ae_promises.search__event_badge = await api.get_ae_obj_li_for_obj_id_crud({

View File

@@ -50,6 +50,7 @@ export let ae_app_local_data_struct: key_val = {
slct__event_id: null,
slct__event_badge_template_id: null,
slct__sponsorship_cfg_id: null,
header_image_path: null,
},
'page_access_code_li': {'administrator': '11500', 'trusted': '19111', 'authenticated': '00000'},

View File

@@ -9,6 +9,7 @@ import { ae_util } from '$lib/ae_utils';
import type { key_val } from '$lib/ae_stores';
export let expire_minutes: number = 10;
export let mount_reload_sec: number = 0;
export let ds_code: string;
export let ds_name: null|string = null;
@@ -133,12 +134,14 @@ onMount(() => {
console.log('Element: Data Store element_data_store.svelte');
// console.log('ae_ MOUNTED Browser detected.');
// Wait for random number of milliseconds to avoid all data stores being reloaded at the same time.
let random_ms = Math.floor(Math.random() * 15000);
console.log(`ae_e_data_store: Random number of milliseconds: ${random_ms}`);
setTimeout(() => {
trigger = 'load__ds__code';
}, random_ms);
if (mount_reload_sec) {
// Wait for random number of milliseconds to avoid all data stores being reloaded at the same time.
let random_ms = Math.floor(Math.random() * mount_reload_sec * 1000);
console.log(`ae_e_data_store: Random number of milliseconds: ${random_ms}`);
setTimeout(() => {
trigger = 'load__ds__code';
}, random_ms);
}
});
// let ds_code_li = {}; //: key_val; // = ae_loc_tmp.ds;