Merge branch 'react-version' of https://github.com/MarcEricMartel/420-5DW-HY-TP into react-version

This commit is contained in:
MarcEricMartel 2022-11-08 07:44:51 -08:00
commit b3e916e50b
2 changed files with 5 additions and 15 deletions

View File

@ -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>

View File

@ -58,23 +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;
}); });
console.log(data); cookies.set('invoice', data, { path: '/', SameSite: 'strict', secure: true, maxAge: 2592000 });
navigate("/reviewinvoice");
const jsonData = JSON.stringify(data);
fetch("https://localhost:7292/api/Invoice", {
mode: "cors",
method: "POST",
credentials: "include",
body: jsonData
}).then((response) => {
console.log(response);
});
} }
} }