From 6d29d85edf0c5a6db981ca0f51cf59a1424630d5 Mon Sep 17 00:00:00 2001 From: Victor Turgeon <76506447+Medenos@users.noreply.github.com> Date: Mon, 7 Nov 2022 20:57:38 -0500 Subject: [PATCH] Setup pour list d'invoices/commandes --- .../grosses-mitaines-ui/src/components/App.js | 2 ++ .../src/components/InvoiceItem.js | 11 ++++++++ .../src/components/InvoiceList.js | 15 ++++++++++ .../src/pages/MyInvoices.js | 28 +++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js create mode 100644 GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js create mode 100644 GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/App.js b/GrossesMitaines/grosses-mitaines-ui/src/components/App.js index 761558d..be50418 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/App.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/App.js @@ -11,6 +11,7 @@ import Login from "../pages/Login"; import Logout from "../pages/Logout"; import Register from "../pages/Register"; import Formulaire from "../pages/Formulaire"; +import MyInvoices from "../pages/MyInvoices"; import { useState, useEffect } from "react"; import React from 'react'; import { useCookies } from 'react-cookie'; @@ -47,6 +48,7 @@ const App = () => { }/> }/> }/> + }/> diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js new file mode 100644 index 0000000..c13bccd --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js @@ -0,0 +1,11 @@ +const InvoiceItem = (invoice) => { + + return ( + <> + Invoice Item + + ); + +} + +export default InvoiceItem; \ No newline at end of file diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js new file mode 100644 index 0000000..f4e2ec8 --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js @@ -0,0 +1,15 @@ +import InvoiceItem from "./InvoiceItem"; + +const InvoiceList = ({ invoices }) => { + return ( + <> + {invoices.map((invoice) => { + + })} + + ); +} + +export default InvoiceList; \ No newline at end of file diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js new file mode 100644 index 0000000..63a8825 --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js @@ -0,0 +1,28 @@ +import { useEffect } from "react"; +import { useState } from "react"; +import InvoiceList from "../components/InvoiceList"; + +const MyInvoices = () => { + + const [invoices, setInvoices] = useState([]); + + useEffect(() => { + fetch(`https://localhost:7292/api/Invoices`, { + method: 'GET', + mode: 'cors', + credentials: 'include' + }).then(async (response) => { + console.log(response); + }); + }, []); + + return ( + <> + + + ); +} + +export default MyInvoices \ No newline at end of file