Bug : Affichages des conges
This commit is contained in:
19
staticfiles/gestion_projet/js/creation_projet.js
Normal file
19
staticfiles/gestion_projet/js/creation_projet.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const boutonEnregistrerProjet = $("btnEnregistrerProjet");
|
||||
|
||||
boutonEnregistrerProjet.addEventListener("click", function() {
|
||||
const formulaire = $("formCreationProjet");
|
||||
const formData = new FormData(formulaire);
|
||||
fetch(formulaire.action, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
headers: {
|
||||
"X-CSRFToken": formData.get("csrfmiddlewaretoken")
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
window.location.reload();
|
||||
alert("Projet enregistré avec succès !");
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user