From e3710a236ed9ecf38a789695049de12a62cadcb2 Mon Sep 17 00:00:00 2001 From: Vins Date: Tue, 13 Feb 2024 10:06:24 +0100 Subject: [PATCH] Document types sorted in deedtype selector --- .../DeedTypes/DeedTypesInformations/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx b/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx index 9dad13f8..c79579ff 100644 --- a/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx +++ b/src/front/Components/Layouts/DeedTypes/DeedTypesInformations/index.tsx @@ -71,12 +71,14 @@ 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, - }; - }); + const documentsOptions: IOption[] = deedType.document_types + ?.map((documentType) => { + return { + label: documentType.name, + value: documentType.uid, + }; + }) + .sort((a, b) => a.label.localeCompare(b.label)); setSelectedDocuments(documentsOptions); }