()
| 5410 | } |
| 5411 | |
| 5412 | async function saveProfile() { |
| 5413 | const userId = $("profileUserId").value.trim() || currentUser(); |
| 5414 | const pdfPaths = $("pdfPaths").value.split(";").map((item) => item.trim()).filter(Boolean); |
| 5415 | const data = await api("/api/profile", { |
| 5416 | method: "POST", |
| 5417 | body: JSON.stringify({ |
| 5418 | user_id: userId, |
| 5419 | natural_language: "", |
| 5420 | scholar_url: $("scholarUrl").value, |
| 5421 | homepage_url: $("homepageUrl").value, |
| 5422 | pdf_paths: pdfPaths, |
| 5423 | core_directions_text: $("profileDirectionsInput")?.value || "", |
| 5424 | topic_weights_text: $("profileTopicsInput")?.value || "", |
| 5425 | must_read_keywords: splitListValue($("profileKeywordsInput")?.value || ""), |
| 5426 | must_read_authors: splitListValue($("profileAuthorsInput")?.value || ""), |
| 5427 | must_read_institutions: splitListValue($("profileInstitutionsInput")?.value || ""), |
| 5428 | reset_existing: $("resetProfile").checked |
| 5429 | }) |
| 5430 | }); |
| 5431 | state.currentUser = userId; |
| 5432 | if (!state.users.some((user) => user.user_id === userId)) { |
| 5433 | state.users.push(normalizeUser(userId)); |
| 5434 | await loadUsers(); |
| 5435 | $("userSelect").value = userId; |
| 5436 | } |
| 5437 | renderProfileForm(data); |
| 5438 | showSettingsMessage(ui().settings.profileLoaded(userId)); |
| 5439 | } |
| 5440 | |
| 5441 | function bindEvents() { |
| 5442 | bindButtonFeedback(); |
nothing calls this directly
no test coverage detected