From d3d27ff75d38416c40910ee6ffd951b9db13fe6e Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Tue, 25 Jul 2023 11:40:37 +0200 Subject: [PATCH] :bug: Fixing deed types --- .../Layouts/DeedTypes/DeedTypesInformations/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx b/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx index ea85a5d1..35fd704c 100644 --- a/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx +++ b/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx @@ -37,6 +37,15 @@ export default function DeedTypesInformations(props: IProps) { }, }); setDeedTypeSelected(deedType); + + if (!deedType.document_types) return; + const documentsOptions: IOption[] = deedType.document_types?.map((documentType) => { + return { + label: documentType.name, + value: documentType.uid, + }; + }); + setSelectedDocuments(documentsOptions); } async function getDocuments() { @@ -44,7 +53,6 @@ export default function DeedTypesInformations(props: IProps) { setAvailableDocuments(documents); } - setSelectedDocuments([]); getDocuments(); getDeedType(); }, [deedTypeUid]);