Relecture du code v1

This commit is contained in:
2026-01-21 11:03:11 +00:00
parent f11d1e62b4
commit 1f523e61b5
392 changed files with 255 additions and 246 deletions

View File

@@ -93,10 +93,13 @@ $("produit_normal").addEventListener("click", function() {
function updateStatut(demandeId, action, motifRefus='') {
const url = $("radioRefuser").dataset.url;
const csrf = document.querySelector('[name=csrfmiddlewaretoken]').value;
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'X-CSRFToken': csrf
},
body: `id=${demandeId}&action=${action}&emetteur=logisticien&motif_refus=${motifRefus}`
})
@@ -144,11 +147,13 @@ table_commande.on("rowClick", function(e, row){
});
$('enregistrerModifsCommande').addEventListener('click', function () {
const csrf = document.querySelector('[name=csrfmiddlewaretoken]').value;
if($("produit_livre").checked){
fetch(`${$("enregistrerModifsCommande").dataset.url}`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRFToken': csrf
},
body: `id_commande=${$("enregistrerModifsCommande").dataset.id}`
})
@@ -181,10 +186,12 @@ const tableau_equipement_rendre = new Tabulator("#tableau-equipement-rendre", {
$("equipementARendreEnregistrer").addEventListener("click", function () {
const information_equipement = tableau_equipement_rendre.getData();
const csrf = document.querySelector('[name=csrfmiddlewaretoken]').value;
fetch(`${$("equipementARendreEnregistrer").dataset.url}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Content-Type": "application/json",
"X-CSRFToken": csrf
},
body: JSON.stringify(information_equipement)
})