MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / refreshReports

Function refreshReports

deployments/desktop/static/desktop.js:2955–2970  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

2953 }
2954
2955 async function refreshReports(options = {}) {
2956 const scopedUser = $("reportsCurrentOnly").checked ? currentUser() : "";
2957 const query = $("reportQuery").value.trim();
2958 const days = $("reportDays").value || "30";
2959 const date = $("reportDate").value || "";
2960 const data = await api(`/api/reports?user_id=${encodeURIComponent(scopedUser)}&q=${encodeURIComponent(query)}&days=${days}&date=${encodeURIComponent(date)}&limit=${REPORT_LIST_LIMIT}`);
2961 state.reports = data.reports || [];
2962 const count = data.count || state.reports.length;
2963 $("reportSources").textContent = (data.source_dirs || []).length
2964 ? ui().reports.directory(data.source_dirs || [], count)
2965 : ui().reports.count(count);
2966 const activeId = options.activeReportId || (options.keepSelection && state.currentReport ? state.currentReport.report_id : state.reports[0]?.report_id || "");
2967 renderReportList(state.reports, activeId);
2968 if (activeId) await loadReportContent(activeId, true);
2969 else clearReportViewer();
2970 }
2971
2972 async function pollReadingTask(taskId, activeReportId = "") {
2973 if (!taskId) return;

Callers 6

setViewFunction · 0.70
openReportFunction · 0.70
deleteReportCardFunction · 0.70
pollReadingTaskFunction · 0.70
saveSettingsFunction · 0.70
bindEventsFunction · 0.70

Calls 7

currentUserFunction · 0.85
uiFunction · 0.85
clearReportViewerFunction · 0.85
$Function · 0.70
apiFunction · 0.70
renderReportListFunction · 0.70
loadReportContentFunction · 0.70

Tested by

no test coverage detected