diff --git a/test.html b/test.html
index 199e6ff..a948f56 100644
--- a/test.html
+++ b/test.html
@@ -68,19 +68,23 @@
function saveProduct() {
const data = {
+ id: document.getElementById('prod-id').value, // Ajoute un champ pour l'ID
name: document.getElementById('prod-name').value,
category: document.getElementById('category-selector').value
};
- // Appel API pour la réconciliation
- fetch('api/index.php?action=update_product', {
+ // Remplace 'update_product' par l'action trouvée dans ton onglet Réseau
+ fetch('api/index.php?action=product_edit', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(r => r.json())
- .then(res => alert("Réponse API : " + JSON.stringify(res)))
- .catch(e => alert("Erreur d'envoi : " + e));
+ .then(res => {
+ console.log("Réponse :", res);
+ alert("Action effectuée avec succès !");
+ })
+ .catch(e => alert("Erreur : " + e));
}