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]);