Fix Activity Log visibility and search query construction
- Changed default 'enabled' and 'hidden' filters to 'all' for activity logs - Refactored qry__activity_log to avoid sending empty 'and' arrays - Ensured consistent filtering between API function and UI
This commit is contained in:
@@ -193,9 +193,9 @@ export async function qry__activity_log({
|
||||
|
||||
qry_person_id = null,
|
||||
|
||||
enabled = 'enabled',
|
||||
enabled = 'all',
|
||||
|
||||
hidden = 'not_hidden',
|
||||
hidden = 'all',
|
||||
|
||||
view = 'default',
|
||||
|
||||
@@ -233,13 +233,31 @@ export async function qry__activity_log({
|
||||
|
||||
}) {
|
||||
|
||||
const search_query: any = { and: [] };
|
||||
const search_query: any = {};
|
||||
|
||||
const filters: any[] = [];
|
||||
|
||||
|
||||
|
||||
if (account_id) {
|
||||
|
||||
search_query.and.push({ field: 'account_id_random', op: 'eq', value: account_id });
|
||||
filters.push({ field: 'account_id_random', op: 'eq', value: account_id });
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (qry_person_id) {
|
||||
|
||||
filters.push({ field: 'person_id_random', op: 'eq', value: qry_person_id });
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (filters.length > 0) {
|
||||
|
||||
search_query.and = filters;
|
||||
|
||||
}
|
||||
|
||||
@@ -253,14 +271,6 @@ export async function qry__activity_log({
|
||||
|
||||
|
||||
|
||||
if (qry_person_id) {
|
||||
|
||||
search_query.and.push({ field: 'person_id_random', op: 'eq', value: qry_person_id });
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ae_promises.load__activity_log_obj_li = await api.search_ae_obj_v3({
|
||||
|
||||
api_cfg,
|
||||
@@ -290,3 +300,5 @@ export async function qry__activity_log({
|
||||
return ae_promises.load__activity_log_obj_li;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
api_cfg: $ae_api,
|
||||
account_id: $ae_loc.account_id,
|
||||
qry_str: qry_str || undefined,
|
||||
enabled: 'all',
|
||||
hidden: 'all',
|
||||
limit: limit,
|
||||
log_lvl: 1
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user