From bf76171a1d872fc96b3c4651bf5a65b21450b096 Mon Sep 17 00:00:00 2001 From: Alan Le Ruyet Date: Thu, 19 Dec 2024 11:19:50 +0100 Subject: [PATCH] =?UTF-8?q?fix(lba-2326):=20am=C3=A9lioration=20regex=20po?= =?UTF-8?q?ur=20contrer=20limite=20conversion=20mongodb=20(#1722)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: amélioration regex pour contrer limite conversion mongodb * fix: snapshot * fix: snapshot --- .../helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap | 2 +- shared/models/applications.model.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap b/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap index d590d82d6..e59d1c7b2 100644 --- a/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap +++ b/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap @@ -58,7 +58,7 @@ exports[`generateOpenApiSchema > should generate proper schema 1`] = ` "applicant_file_name": { "description": "Nom du fichier du CV du candidat. Seuls les .docx et .pdf sont autorisés.", "minLength": 1, - "pattern": "((.*?))(\\.)+(docx|pdf)$", + "pattern": "((.*?))(\\.)+([Dd][Oo][Cc][Xx]|[Pp][Dd][Ff])$", "type": "string", }, "applicant_first_name": { diff --git a/shared/models/applications.model.ts b/shared/models/applications.model.ts index 249b9d6c5..6a5aa576c 100644 --- a/shared/models/applications.model.ts +++ b/shared/models/applications.model.ts @@ -39,7 +39,7 @@ export const ZApplication = z applicant_attachment_name: z .string() .min(1) - .regex(/((.*?))(\.)+(docx|pdf)$/i) + .regex(/((.*?))(\.)+([Dd][Oo][Cc][Xx]|[Pp][Dd][Ff])$/i) .describe("Nom du fichier du CV du candidat. Seuls les .docx et .pdf sont autorisés."), applicant_message_to_company: z.string().nullable().describe("Un message du candidat vers le recruteur. Ce champ peut contenir la lettre de motivation du candidat."), job_searched_by_user: z.string().nullish().describe("Métier recherché par le candidat"),