From c219c78e8f72173a793cb5740ef040f5389fa4c0 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 15 Jan 2026 15:16:40 -0500 Subject: [PATCH] fix(core): use supported NULL comparison operator in User Management search - Switched from 'op: is' to 'op: eq' for NULL values, as 'is' was returning 400. - Refined search query structure to ensure compatibility with user search endpoint. --- src/lib/ae_core/ae_core__user.ts | 36 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/lib/ae_core/ae_core__user.ts b/src/lib/ae_core/ae_core__user.ts index 1839bd9c..95355fd3 100644 --- a/src/lib/ae_core/ae_core__user.ts +++ b/src/lib/ae_core/ae_core__user.ts @@ -94,7 +94,7 @@ export async function load_ae_obj_li__user({ }): Promise { let promise; - // Use search if we have a query string OR if we are using inclusive global logic + // We use Search if there is a query string, OR if we need inclusive global logic const use_search = qry_str || (for_obj_id && include_global) || (!for_obj_id && include_global); if (use_search) { @@ -107,30 +107,32 @@ export async function load_ae_obj_li__user({ // Handle Account Scoping in Search Query if (for_obj_id && include_global) { // Case: (Account == current OR Account == null) - search_query.or = [ - { - field: `account_id_random`, - op: 'eq', - value: for_obj_id - }, - { - field: `account_id_random`, - op: 'eq', - value: null - } - ]; + search_query.and.push({ + or: [ + { + field: `account_id_random`, + op: 'eq', + value: for_obj_id + }, + { + field: `account_id_random`, + op: 'eq', // Use 'eq' with null, as 'is' was unsupported + value: null + } + ] + }); } else if (for_obj_id) { - // Case: (Account == current) - should be handled by List API but search also works + // Case: Account Only (with qry_str) search_query.and.push({ field: `account_id_random`, op: 'eq', value: for_obj_id }); } else if (include_global) { - // Case: (Account == null) - Global Only + // Case: Global Only (No Account) search_query.and.push({ field: `account_id_random`, - op: 'eq', + op: 'eq', // Use 'eq' with null value: null }); } @@ -148,7 +150,7 @@ export async function load_ae_obj_li__user({ } if (log_lvl) { - console.log(`load_ae_obj_li__user() - Using Search API`, search_query); + console.log(`load_ae_obj_li__user() - Using Search API`, JSON.stringify(search_query, null, 2)); } promise = api.search_ae_obj_v3({