()
| 1264 | } |
| 1265 | |
| 1266 | async function saveProfile() { |
| 1267 | const userId = $("profileUserId").value.trim(); |
| 1268 | const pdfPaths = $("pdfPaths").value |
| 1269 | .split(";") |
| 1270 | .map((item) => item.trim()) |
| 1271 | .filter(Boolean); |
| 1272 | setStatus("保存画像", true); |
| 1273 | const data = await api("/api/profile", { |
| 1274 | method: "POST", |
| 1275 | body: JSON.stringify({ |
| 1276 | user_id: userId, |
| 1277 | natural_language: $("naturalLanguage").value, |
| 1278 | scholar_url: $("scholarUrl").value, |
| 1279 | homepage_url: $("homepageUrl").value, |
| 1280 | pdf_paths: pdfPaths, |
| 1281 | reset_existing: $("resetProfile").checked, |
| 1282 | }), |
| 1283 | }); |
| 1284 | await loadUsers(userId); |
| 1285 | setActiveUser(userId); |
| 1286 | renderProfile(data.profile || {}); |
| 1287 | setStatus("画像已保存"); |
| 1288 | } |
| 1289 | |
| 1290 | async function refreshSettings() { |
| 1291 | const data = await api("/api/settings"); |
nothing calls this directly
no test coverage detected