feat: update event file and session search to support V3 API filters

This commit is contained in:
Scott Idem
2026-01-29 15:51:41 -05:00
parent 6c8118fc82
commit 99345c93a9
3 changed files with 49 additions and 14 deletions

View File

@@ -342,6 +342,10 @@ export async function search__event_session({
like_presenter_search_qry_str = '',
like_poc_name_qry_str = '',
location_name = null,
qry_files = null,
qry_poc_agree = null,
qry_poc_kv_json = null,
qry_start_datetime = null,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 50,
@@ -363,6 +367,10 @@ export async function search__event_session({
like_presenter_search_qry_str?: string;
like_poc_name_qry_str?: string;
location_name?: null | string;
qry_files?: null | boolean;
qry_poc_agree?: null | boolean;
qry_poc_kv_json?: null | boolean;
qry_start_datetime?: string | null;
enabled?: 'enabled' | 'all' | 'not_enabled';
hidden?: 'hidden' | 'all' | 'not_hidden';
limit?: number;
@@ -377,7 +385,7 @@ export async function search__event_session({
const search_query: any = {
q: '',
and: [{ field: 'event_id', op: 'eq', value: event_id }]
and: [{ field: 'event_id_random', op: 'eq', value: event_id }]
};
const params: key_val = {};
@@ -410,6 +418,19 @@ export async function search__event_session({
search_query.and.push({ field: 'event_location_name', op: 'like', value: `%${location_name}%` });
}
if (qry_files !== null) {
if (qry_files === true) search_query.and.push({ field: 'file_count_all', op: 'gt', value: 0 });
else search_query.and.push({ field: 'file_count_all', op: 'eq', value: 0 });
}
if (qry_poc_agree !== null) {
search_query.and.push({ field: 'poc_agree', op: 'eq', value: qry_poc_agree ? 1 : 0 });
}
if (qry_start_datetime) {
search_query.and.push({ field: 'start_datetime', op: 'gte', value: qry_start_datetime });
}
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 });