BAGUETTE 🍞
This commit is contained in:
parent
33596177f6
commit
5f4a488274
@ -52,7 +52,7 @@ const App = () => {
|
|||||||
<Route path="formulaire" element={<Formulaire />} />
|
<Route path="formulaire" element={<Formulaire />} />
|
||||||
<Route path="myinvoices" element={<MyInvoices />} />
|
<Route path="myinvoices" element={<MyInvoices />} />
|
||||||
<Route path="invoices" element={<Invoices />} />
|
<Route path="invoices" element={<Invoices />} />
|
||||||
<Route path="reviewinvoice/:id" element={<ReviewInvoice />} />
|
<Route path="reviewinvoice" element={<ReviewInvoice />} />
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
@ -58,26 +58,13 @@ export default function App() {
|
|||||||
console.log("Your cart is empty!!!");
|
console.log("Your cart is empty!!!");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
data.prodQuant ={};
|
data.prodQuant = {};
|
||||||
cart.map((p) => {
|
cart.map((p) => {
|
||||||
data.prodQuant[`${p.id}`] = p.quantity;
|
data.prodQuant[`${p.id}`] = p.quantity;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cookies.set('invoice', data, { path: '/', SameSite: 'strict', secure: true, maxAge: 2592000 });
|
||||||
const jsonData = JSON.stringify(data);
|
navigate("/reviewinvoice");
|
||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user