diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index 186e40da..6f080624 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -57,8 +57,15 @@ export default function ClientDashboard(props: IProps) { const actualCustomer = folder?.customers?.find((customer) => customer.contact?.email === jwt?.email); if (!actualCustomer) throw new Error("Customer not found"); - const note = folder.notes?.find((note) => note.customer?.uid === actualCustomer.uid); - if (!note) throw new Error("Note not found"); + let note = folder.notes?.find((note) => note.customer?.uid === actualCustomer.uid); + // if (!note) throw new Error("Note not found"); + if (!note) { + note = { + content: "Aucune note", + created_at: new Date(), + updated_at: new Date(), + }; + } const query: IGetDocumentsparams = { where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string },