Fix: Harden V3 search logic and restore specialized business mapping
- API: Updated `search_ae_obj_v3` to correctly serialize complex URL parameters (JSON). - Events: Restored "sacred" business logic for Event Badge and Session searches using `ft_qry` and `lk_qry`. - PWA: Fixed manifest path in `app.html` to resolve 404 errors. - Documentation: Updated `GEMINI.md` and `TODO.md` with recent search hardening accomplishments.
This commit is contained in:
@@ -14,6 +14,7 @@ interface SearchAeObjV3Params {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
delay_ms?: number;
|
||||
params?: key_val;
|
||||
headers?: any;
|
||||
log_lvl?: number;
|
||||
}
|
||||
@@ -31,29 +32,38 @@ export async function search_ae_obj_v3({
|
||||
limit = 100,
|
||||
offset = 0,
|
||||
delay_ms = 0,
|
||||
params = {},
|
||||
headers = {},
|
||||
log_lvl = 0
|
||||
}: SearchAeObjV3Params) {
|
||||
const endpoint = `/v3/crud/${obj_type}/search`;
|
||||
|
||||
// Hybrid search: Standard filters passed as query params
|
||||
const params: key_val = {
|
||||
const query_params: key_val = {
|
||||
enabled,
|
||||
hidden,
|
||||
view,
|
||||
limit,
|
||||
offset
|
||||
offset,
|
||||
...params
|
||||
};
|
||||
|
||||
if (for_obj_type) params['for_obj_type'] = for_obj_type;
|
||||
if (for_obj_id) params['for_obj_id'] = for_obj_id;
|
||||
if (order_by_li) params['order_by_li'] = JSON.stringify(order_by_li);
|
||||
if (delay_ms > 0) params['delay_ms'] = delay_ms;
|
||||
if (for_obj_type) query_params['for_obj_type'] = for_obj_type;
|
||||
if (for_obj_id) query_params['for_obj_id'] = for_obj_id;
|
||||
if (order_by_li) query_params['order_by_li'] = JSON.stringify(order_by_li);
|
||||
if (delay_ms > 0) query_params['delay_ms'] = delay_ms;
|
||||
|
||||
// Serialize any complex objects in the query params (e.g. ft_qry, lk_qry)
|
||||
for (const key in query_params) {
|
||||
if (typeof query_params[key] === 'object' && query_params[key] !== null) {
|
||||
query_params[key] = JSON.stringify(query_params[key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('*** search_ae_obj_v3 ***');
|
||||
console.log('Endpoint:', endpoint);
|
||||
console.log('Params:', params);
|
||||
console.log('Params:', query_params);
|
||||
console.log('Search Query:', search_query);
|
||||
}
|
||||
|
||||
@@ -61,7 +71,7 @@ export async function search_ae_obj_v3({
|
||||
return await post_object({
|
||||
api_cfg,
|
||||
endpoint,
|
||||
params,
|
||||
params: query_params,
|
||||
headers,
|
||||
data: search_query,
|
||||
log_lvl
|
||||
|
||||
Reference in New Issue
Block a user