Merge branch 'dev' into staging

This commit is contained in:
Vins 2024-06-12 10:02:28 +02:00
commit 86c3960330

View File

@ -57,8 +57,15 @@ export default function ClientDashboard(props: IProps) {
const actualCustomer = folder?.customers?.find((customer) => customer.contact?.email === jwt?.email); const actualCustomer = folder?.customers?.find((customer) => customer.contact?.email === jwt?.email);
if (!actualCustomer) throw new Error("Customer not found"); if (!actualCustomer) throw new Error("Customer not found");
const note = folder.notes?.find((note) => note.customer?.uid === actualCustomer.uid); let note = folder.notes?.find((note) => note.customer?.uid === actualCustomer.uid);
if (!note) throw new Error("Note not found"); // 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 = { const query: IGetDocumentsparams = {
where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string }, where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string },