Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,15 @@ if (isIndexPage) {
// Form submission and API call
// ----------------------------------------------------------

form.addEventListener("submit", function (evt) {
evt.preventDefault();
form.addEventListener("submit", function (evt) {
evt.preventDefault();

clearAllErrors();
clearAllErrors();

if (skillsTextInput.value.trim()) {
addSkill(skillsTextInput.value);
skillsTextInput.value = "";
hideSuggestions();
if (skillsTextInput.value.trim()) {
addSkill(skillsTextInput.value);
skillsTextInput.value = "";
hideSuggestions();
}

if (!validateForm()) return;
Expand Down Expand Up @@ -733,24 +733,17 @@ if (isIndexPage) {
if (generalErr) {
generalErr.textContent = data.error;
}

return;
}

renderResults(data.projects || [], data.message);
})
.catch(function (err) {

.catch(function () {
setLoadingState(false);

var generalErr = document.getElementById("form-error-general");

if (generalErr) {
generalErr.textContent =
"Something went wrong. Please try again.";
"Something went wrong while fetching recommendations.";
}

console.error("API request failed:", err);
});
});
});
Expand Down Expand Up @@ -830,6 +823,7 @@ if (isIndexPage) {
resultsSection.scrollIntoView({ behavior: "smooth" });
}


function buildProjectCard(project) {
var card = document.createElement("div");
card.className = "project-card";
Expand Down Expand Up @@ -1400,4 +1394,4 @@ updateRoadmapProgress();
handleScroll();
}

})();
})();
Loading