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

Function saveProfile

deployments/desktop/static/desktop.js:5412–5439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 9

currentUserFunction · 0.85
splitListValueFunction · 0.85
normalizeUserFunction · 0.85
renderProfileFormFunction · 0.85
showSettingsMessageFunction · 0.85
uiFunction · 0.85
$Function · 0.70
apiFunction · 0.70
loadUsersFunction · 0.70

Tested by

no test coverage detected