From 65eb253f41fdabe71f262295d34bcc4623efbb35 Mon Sep 17 00:00:00 2001 From: Jonathan Hardy Date: Tue, 19 Nov 2024 16:25:04 +0000 Subject: [PATCH] swapped the priority of the error messages for cert uploads --- .../src/app/shared/validators/custom-form-validators.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/shared/validators/custom-form-validators.ts b/frontend/src/app/shared/validators/custom-form-validators.ts index 718a334cd7..3caaf532f8 100644 --- a/frontend/src/app/shared/validators/custom-form-validators.ts +++ b/frontend/src/app/shared/validators/custom-form-validators.ts @@ -134,14 +134,14 @@ export class CustomValidators extends Validators { let errors = []; const maxFileSize = 5 * 1024 * 1024; - if (files.some((file) => file.size > maxFileSize)) { - errors.push('The certificate must be no larger than 5MB'); - } - if (files.some((file) => !file.name.toLowerCase().endsWith('.pdf'))) { errors.push('The certificate must be a PDF file'); } + if (files.some((file) => file.size > maxFileSize)) { + errors.push('The certificate must be no larger than 5MB'); + } + return errors.length ? errors : null; } }