From db2c09798daf659bf8c7f8c4890fdc59d50d64fc Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 27 Apr 2023 14:58:04 +0200 Subject: [PATCH] :bug: Removing console log --- src/front/Components/DesignSystem/FolderList/index.tsx | 2 +- .../DesignSystem/UserFolder/UserFolderHeader/index.tsx | 2 -- .../Components/Layouts/Folder/FolderInformation/index.tsx | 4 ++-- src/front/Components/Layouts/Folder/ViewDocuments/index.tsx | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index cbb20bec..07bf0672 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -28,7 +28,7 @@ class FolderListClass extends React.Component { return (
{this.props.folders.sort((folder) => { - const pendingDocuments = folder.documents!.filter((document) => document.document_status === "PENDING"); + const pendingDocuments = (folder.documents ?? []).filter((document) => document.document_status === "PENDING"); return pendingDocuments.length >= 1 ? -1 : 1; }).map((folder) => { return ( diff --git a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx index 7c84edd4..86c1af88 100644 --- a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx @@ -73,8 +73,6 @@ export default class UserFolderHeader extends React.Component { private hasPendingFiles(){ const documents = this.props.folder.documents?.filter((document) => document.depositor.contact.uid === this.props.contact.uid) ?? []; const notAskedDocuments = documents.filter((document) => document.document_status === "PENDING") ?? []; - console.log(this.props.contact.uid); - console.log(notAskedDocuments.length); return notAskedDocuments.length > 0; } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 567cacc2..7227027d 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -158,8 +158,8 @@ class FolderInformationClass extends BasePage { private async getFolder(): Promise { const query = { q: { - deed: { include: { deed_type: "true" } }, - office: "true", + deed: { include: { deed_type: true } }, + office: true, office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, }, }; diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 811be98a..1744916c 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -280,7 +280,6 @@ export default function ViewDocuments(props: IProps) { let { folderUid, documentUid } = router.query; const folder = folders.find((folder) => folder.uid === folderUid) ?? null; - console.log(folder); const documents = folder?.documents!.filter((document) => document.document_status !== "ASKED") ?? []; const selectedDocument = documents.find((document) => document.uid === documentUid) ?? null; return ;