fix(DevWeb): Remove unused JS files

This commit is contained in:
Lucàs
2024-04-20 10:22:51 +02:00
parent 4d35a01a2a
commit 3fda75929a
3 changed files with 0 additions and 60 deletions
@@ -1,13 +0,0 @@
const ERROR_MESSAGE = {
"expired-token": "Lien expiré, veuillez recommencer la procédure de récupération de mot de passe.",
"invalid-token": "Lien invalide, veuillez recommencer la procédure de récupération de mot de passe.",
};
const urlParams = new URLSearchParams(window.location.search);
const error = urlParams.get('error');
if (error) {
const errorMessage = ERROR_MESSAGE[error];
console.error(errorMessage);
window.alert(errorMessage);
}
@@ -1,16 +0,0 @@
let cb = document.querySelectorAll(".close");
for (let i = 0; i < cb.length; i++) {
cb[i].addEventListener("click", function() {
const dia = this.parentNode.parentNode; /* You need to update this part if you change level of close button */
dia.style.display = "none";
});
}
let mt = document.querySelectorAll(".modal-toggle");
for (let i = 0; i < mt.length; i++) {
mt[i].addEventListener("click", function() {
const targetId = this.getAttribute("data-target");
const target = document.querySelector(targetId);
target.style.display = "block";
});
}
@@ -1,31 +0,0 @@
const resetPasswordForm = document.getElementById("resetPasswordForm");
const confirmPassword = document.getElementById("confirmPassword");
resetPasswordForm.addEventListener("submit", function (event) {
event.preventDefault();
const formData = new FormData(resetPasswordForm);
const data = {};
formData.forEach((value, key) => data[key] = value);
const action = loginForm.getAttribute("action")
const method = loginForm.getAttribute("method")
fetch("/reset-password", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
}).then(response => {
if (response.ok) {
window.location.href = "/login";
} else {
response.json().then(data => {
alert(data.message);
});
}
}).catch(error => {
console.error("Error:", error);
});
});