fix(reports): resolve TypeError in Jitsi reports and restore filtering
- Added Array.isArray check to prevent 'not iterable' error on API failure responses. - Restored params_json to narrow the activity_log query and prevent potential timeouts. - Cleaned up minor whitespace in sort logic.
This commit is contained in:
@@ -45,15 +45,13 @@ export async function load_jitsi_report({
|
|||||||
// use_alt_mdl: true,
|
// use_alt_mdl: true,
|
||||||
enabled: 'all',
|
enabled: 'all',
|
||||||
hidden: 'all',
|
hidden: 'all',
|
||||||
// order_by_li: { created_on: 'DESC' },
|
|
||||||
limit: 500, // Fetch a reasonable number of recent logs
|
limit: 500, // Fetch a reasonable number of recent logs
|
||||||
// order_by_li: { created_on: 'DESC' },
|
params_json: params_json,
|
||||||
// params_json: params_json,
|
|
||||||
log_lvl: 2
|
log_lvl: 2
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!flat_log_list || flat_log_list.length === 0) {
|
if (!flat_log_list || !Array.isArray(flat_log_list) || flat_log_list.length === 0) {
|
||||||
if (log_lvl) console.log('No Jitsi activity logs found.');
|
if (log_lvl) console.log('No Jitsi activity logs found or error occurred.');
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +105,7 @@ export async function load_jitsi_report({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const final_report = Array.from(meetings.values());
|
const final_report = Array.from(meetings.values());
|
||||||
final_report.sort((a,b) => new Date(b.start_time).getTime() - new Date(a.start_time).getTime());
|
final_report.sort((a, b) => new Date(b.start_time).getTime() - new Date(a.start_time).getTime());
|
||||||
|
|
||||||
if (log_lvl) console.log('Final Jitsi report:', final_report);
|
if (log_lvl) console.log('Final Jitsi report:', final_report);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user