diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Formulaire.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Formulaire.js index c3cd565..27516fe 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Formulaire.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Formulaire.js @@ -60,17 +60,20 @@ export default function App() { else { data.prodQuant ={}; cart.map((p) => { - data.prodQuant[p.id] = p.quantity; + data.prodQuant[`${p.id}`] = p.quantity; }); - console.log(data); - + const jsonData = JSON.stringify(data); - + + console.log(jsonData); fetch("https://localhost:7292/api/Invoice", { mode: "cors", method: "POST", credentials: "include", + headers:{ + 'Content-Type': 'application/json' + }, body: jsonData }).then((response) => { console.log(response);