diff --git a/packages/reva-api/modules/referential/features/getDomainsByCertificationId.ts b/packages/reva-api/modules/referential/features/getDomainsByCertificationId.ts index 587680f1f..ea83e79ae 100644 --- a/packages/reva-api/modules/referential/features/getDomainsByCertificationId.ts +++ b/packages/reva-api/modules/referential/features/getDomainsByCertificationId.ts @@ -52,7 +52,9 @@ export const getDomainsByCertificationId = async ({ domains.push({ id: parent.id, code: parent.code, - label: parent.label, + label: parent.label + .toLowerCase() + .replace(/^./, (str) => str.toUpperCase()), children: [subDomain], }); } diff --git a/packages/reva-api/modules/referential/features/getFormacodes.ts b/packages/reva-api/modules/referential/features/getFormacodes.ts index 80c5afe48..892f338f0 100644 --- a/packages/reva-api/modules/referential/features/getFormacodes.ts +++ b/packages/reva-api/modules/referential/features/getFormacodes.ts @@ -15,9 +15,9 @@ export async function getFormacodes(): Promise { const formacodes: Formacode[] = codes.map((formacode) => ({ id: formacode.id, code: formacode.code, - label: formacode.parentCode - ? formacode.label.toLowerCase().replace(/^./, (str) => str.toUpperCase()) - : formacode.label, + label: formacode.label + .toLowerCase() + .replace(/^./, (str) => str.toUpperCase()), type: formacode.type, parentCode: formacode.parentCode || undefined, }));