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

Function deleteReportCard

deployments/desktop/static/desktop.js:2802–2824  ·  view source on GitHub ↗
(reportId)

Source from the content-addressed store, hash-verified

2800 }
2801
2802 async function deleteReportCard(reportId) {
2803 if (!reportId) return;
2804 const report = state.reports.find((item) => item.report_id === reportId) || state.currentReport || {};
2805 const title = report.title || ui().reports.defaultTitle;
2806 const confirmText = responseLanguage() === "en"
2807 ? `Delete this local reading report?\n\n${title}`
2808 : `删除这个本地精读报告?\n\n${title}`;
2809 if (!window.confirm(confirmText)) return;
2810 await api("/api/reports/delete", {
2811 method: "POST",
2812 body: JSON.stringify({ report_id: reportId })
2813 });
2814 state.highlightedReports.delete(reportId);
2815 saveReportCardHighlights();
2816 try {
2817 window.localStorage.removeItem(reportAnnotationKey(reportId));
2818 } catch (error) {
2819 console.warn("Unable to clear deleted report annotation", error);
2820 }
2821 if (state.currentReport?.report_id === reportId) clearReportViewer();
2822 showFeedbackToast("success", responseLanguage() === "en" ? "Report deleted" : "报告已删除", title);
2823 await refreshReports({ keepSelection: false });
2824 }
2825
2826 function loadReportAnnotation(reportId) {
2827 if (!reportId) return "";

Callers 1

ensureReportContextMenuFunction · 0.85

Calls 8

uiFunction · 0.85
responseLanguageFunction · 0.85
saveReportCardHighlightsFunction · 0.85
reportAnnotationKeyFunction · 0.85
clearReportViewerFunction · 0.85
showFeedbackToastFunction · 0.85
apiFunction · 0.70
refreshReportsFunction · 0.70

Tested by

no test coverage detected