fix(DevWeb): Import static files

This commit is contained in:
Lucàs
2024-04-05 12:39:01 +02:00
parent c438395a1a
commit 61603ddac6
26 changed files with 36 additions and 170 deletions
@@ -0,0 +1,29 @@
const loginForm = document.getElementById("login-form");
loginForm.addEventListener("submit", (event) => {
event.preventDefault();
const formData = new FormData(loginForm);
const data = {};
formData.forEach((value, key) => data[key] = value);
fetch(loginForm.getAttribute("action"), {
headers: {"Content-Type": "application/json"},
body: JSON.stringify(data),
method: loginForm.getAttribute("method"),
})
.then(res => res.json())
.then(d => window.location.href = "./main-menu")
.catch(error => console.error("Error:", error));
});
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('success')) {
if (urlParams.get('success') === "account-created") {
window.alert("Compte créé avec succès.");
}
if (urlParams.get('success') === "password-reseted") {
window.alert("Mot de passe réinitialisé avec succès.");
}
}