Fix: Restore specialized search logic for Event Sessions and Presenters

This commit is contained in:
Scott Idem
2026-01-21 14:05:17 -05:00
parent d705058175
commit 95f2ab79be
3 changed files with 156 additions and 34 deletions

View File

@@ -301,11 +301,12 @@ export async function update_ae_obj__event_presenter({
return result;
}
// Updated 2026-01-20 to V3
// Updated 2026-01-21 to Restore Full Aether Search Logic
export async function search__event_presenter({
api_cfg,
event_id,
qry_str = '',
fulltext_search_qry_str = '',
like_search_qry_str = '',
agree = null,
biography = null,
enabled = 'enabled',
@@ -313,8 +314,7 @@ export async function search__event_presenter({
limit = 25,
offset = 0,
order_by_li = [
{ priority: 'DESC' },
{ sort: 'DESC' },
{ sort: 'ASC' },
{ given_name: 'ASC' },
{ family_name: 'ASC' }
],
@@ -323,7 +323,8 @@ export async function search__event_presenter({
}: {
api_cfg: any;
event_id: string;
qry_str?: string;
fulltext_search_qry_str?: string;
like_search_qry_str?: string;
agree?: null | boolean;
biography?: null | boolean;
enabled?: 'enabled' | 'all' | 'not_enabled';
@@ -335,28 +336,41 @@ export async function search__event_presenter({
log_lvl?: number;
}): Promise<ae_EventPresenter[]> {
if (log_lvl) {
console.log(`*** search__event_presenter() *** [V3] event_id=${event_id} qry=${qry_str}`);
console.log(`*** search__event_presenter() *** [V3] event_id=${event_id} ft=${fulltext_search_qry_str}`);
}
const search_query: any = {
q: qry_str,
q: '',
and: [{ field: 'event_id_random', op: 'eq', value: event_id }]
};
if (agree !== null) search_query.and.push({ field: 'agree', op: 'eq', value: agree });
const params: key_val = {};
// Restore Fulltext logic
if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) {
params['ft_qry'] = { 'default_qry_str': fulltext_search_qry_str };
}
// Restore Like logic
if (like_search_qry_str) {
params['lk_qry'] = { 'default_qry_str': like_search_qry_str };
}
if (agree !== null) search_query.and.push({ field: 'agree', op: 'eq', value: agree ? 1 : 0 });
if (biography === true) search_query.and.push({ field: 'biography', op: 'ne', value: '' });
if (enabled === 'enabled') search_query.and.push({ field: 'enable', op: 'eq', value: true });
else if (enabled === 'not_enabled') search_query.and.push({ field: 'enable', op: 'eq', value: false });
if (enabled === 'enabled') search_query.and.push({ field: 'enable', op: 'eq', value: 1 });
else if (enabled === 'not_enabled') search_query.and.push({ field: 'enable', op: 'eq', value: 0 });
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: true });
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: false });
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 1 });
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 0 });
const result_li = await api.search_ae_obj_v3({
api_cfg,
obj_type: 'event_presenter',
search_query,
order_by_li,
params,
limit,
offset,
log_lvl
@@ -487,6 +501,7 @@ export const properties_to_save = [
/**
* NON-EXPORTED LOCAL HELPER
* Processes a list of Aether objects by applying common and specific transformations.
*/
async function _process_generic_props<T extends Record<string, any>>({
obj_li,