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

Function updateMustRead

deployments/desktop/static/app.js:1204–1217  ·  view source on GitHub ↗
(action)

Source from the content-addressed store, hash-verified

1202}
1203
1204async function updateMustRead(action) {
1205 const userId = ensureUser();
1206 const itemType = $("mustReadType").value;
1207 const value = $("mustReadValue").value.trim();
1208 if (!value) throw new Error("请输入必读规则的值。");
1209 setStatus(`${action === "add" ? "添加" : "移除"}必读规则`, true);
1210 const data = await api("/api/must-read", {
1211 method: "POST",
1212 body: JSON.stringify({ user_id: userId, item_type: itemType, value, action }),
1213 });
1214 renderMustRead(data.must_read || {});
1215 await refreshProfile();
1216 setStatus("必读规则已更新");
1217}
1218
1219async function refreshWikiStats() {
1220 const userId = activeUser();

Callers 1

bindEventsFunction · 0.85

Calls 6

ensureUserFunction · 0.85
renderMustReadFunction · 0.85
refreshProfileFunction · 0.85
$Function · 0.70
setStatusFunction · 0.70
apiFunction · 0.70

Tested by

no test coverage detected