From aaf4de5e6b747c5d8d204cfeb4eaa853a54f4842 Mon Sep 17 00:00:00 2001 From: morgane Date: Wed, 17 Jun 2026 17:50:58 +0000 Subject: [PATCH] Actualiser test.html --- test.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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)); }