Saving changes to the Journals and API CRUD V3 fixes.

This commit is contained in:
Scott Idem
2026-01-02 19:30:33 -05:00
parent 33d42ed85b
commit 6eb601f56d
6 changed files with 123 additions and 107 deletions

View File

@@ -4,7 +4,12 @@ import { post_object } from './api_post_object';
interface SearchAeObjV3Params {
api_cfg: any;
obj_type: string;
search_query: any; // Complex SearchQuery object
search_query: any; // Complex SearchQuery object: { q: string, and: [], or: [] }
enabled?: 'all' | 'enabled' | 'not_enabled';
hidden?: 'all' | 'hidden' | 'not_hidden';
view?: string;
for_obj_type?: string;
for_obj_id?: string;
order_by_li?: Record<string, 'ASC' | 'DESC'> | null;
limit?: number;
offset?: number;
@@ -16,6 +21,11 @@ export async function search_ae_obj_v3({
api_cfg,
obj_type,
search_query,
enabled = 'enabled',
hidden = 'not_hidden',
view = 'default',
for_obj_type,
for_obj_id,
order_by_li = null,
limit = 100,
offset = 0,
@@ -24,11 +34,17 @@ export async function search_ae_obj_v3({
}: SearchAeObjV3Params) {
const endpoint = `/v3/crud/${obj_type}/search`;
// Hybrid search: Standard filters passed as query params
const params: key_val = {
enabled,
hidden,
view,
limit,
offset
};
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;
@@ -47,4 +63,4 @@ export async function search_ae_obj_v3({
data: search_query,
log_lvl
});
}
}