fix: implement qry_files filter in search__event_session (sessions with/without files)
qry_files was accepted as a parameter but never applied to the search query, causing the "Sessions With/Without Files" report toggle to always return all sessions regardless of the setting. When qry_files !== null, automatically switch to the 'alt' view (v_event_session_w_file_count) which exposes file_count, then add: true → file_count > 0 (sessions with files) false → file_count = 0 (sessions without files) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -734,6 +734,17 @@ export async function search__event_session({
|
||||
});
|
||||
}
|
||||
|
||||
// qry_files: true = sessions WITH files (file_count > 0)
|
||||
// false = sessions WITHOUT files (file_count = 0)
|
||||
// Requires the 'alt' view which includes file_count via v_event_session_w_file_count.
|
||||
if (qry_files === true) {
|
||||
view = 'alt';
|
||||
search_query.and.push({ field: 'file_count', op: 'gt', value: 0 });
|
||||
} else if (qry_files === false) {
|
||||
view = 'alt';
|
||||
search_query.and.push({ field: 'file_count', op: 'eq', value: 0 });
|
||||
}
|
||||
|
||||
const result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_session',
|
||||
|
||||
Reference in New Issue
Block a user