Actualiser test.html
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
This commit is contained in:
@@ -82,17 +82,22 @@
|
|||||||
|
|
||||||
for (const checkbox of checkedBoxes) {
|
for (const checkbox of checkedBoxes) {
|
||||||
let p = fullProductList[checkbox.dataset.index];
|
let p = fullProductList[checkbox.dataset.index];
|
||||||
p.category = newCat; // Mise à jour de la catégorie
|
p.category = newCat;
|
||||||
|
|
||||||
await fetch('api/index.php?action=product_save', {
|
console.log("Envoi au serveur :", JSON.stringify(p)); // <--- Affiche ce qui est envoyé
|
||||||
|
|
||||||
|
let response = await fetch('api/index.php?action=product_save', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify(p)
|
body: JSON.stringify(p)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let result = await response.json();
|
||||||
|
console.log("Résultat serveur :", result); // <--- Affiche ce que le serveur répond
|
||||||
}
|
}
|
||||||
|
|
||||||
alert("Modification effectuée sur " + checkedBoxes.length + " produit(s).");
|
alert("Traitement terminé. Regarde la console (F12) pour voir si le serveur a validé.");
|
||||||
renderTable();
|
renderTable(); // Recharge l'affichage
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user