From fc324d55f58a856327c486dd05d0c784a573d6c1 Mon Sep 17 00:00:00 2001 From: morgane Date: Wed, 17 Jun 2026 19:22:09 +0000 Subject: [PATCH] Actualiser test.html --- test.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test.html b/test.html index 33f53ea..f8772e9 100644 --- a/test.html +++ b/test.html @@ -68,6 +68,22 @@ category: document.getElementById('category-selector').value }; + console.log("Données envoyées :", data); // Vérifie ceci dans ta console F12 + + fetch('api/index.php?action=product_save', { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify(data) + }) + .then(r => r.json()) + .then(res => { + // Affiche tout l'objet de réponse pour voir le message d'erreur précis + console.log("RÉPONSE COMPLÈTE DE L'API :", res); + alert("Réponse reçue (voir console F12) : " + JSON.stringify(res)); + }) + .catch(e => console.error("Erreur réseau :", e)); + } + // On utilise l'action 'product_save' identifiée par ton grep fetch('api/index.php?action=product_save', { method: 'POST',