Correction modification profil employé
This commit is contained in:
@@ -24,7 +24,6 @@ enregistrerProfil.addEventListener("click", (e) => {
|
||||
const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value;
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append("nom", $("nom").value);
|
||||
formData.append("prenom", $("prenom").value);
|
||||
formData.append("email", $("email").value);
|
||||
@@ -32,6 +31,10 @@ enregistrerProfil.addEventListener("click", (e) => {
|
||||
formData.append("adresse", $("adresse").value);
|
||||
formData.append("sexe", $("sexe").value);
|
||||
formData.append("date_naissance", $("date_naissance").value);
|
||||
const photoInput = $("photo");
|
||||
if (photoInput.files.length > 0) {
|
||||
formData.append("photo", photoInput.files[0]);
|
||||
}
|
||||
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user