import { useEffect } from "react"; import { useState } from "react"; import InvoiceList from "../components/InvoiceList"; const Invoices = () => { const [invoices, setInvoices] = useState([]); useEffect(() => { fetch(`https://localhost:7292/api/Invoice?all=true`, { method: 'GET', mode: 'cors', credentials: 'include' }).then(async (response) => { if (response.ok) { var json = await response.json(); console.log(json); setInvoices(json); } else{ console.log("Erreur lors de la requĂȘte des invoices"); } }); }, []); return ( <> ); } export default Invoices