Skip to content

Commit

Permalink
swapped the priority of the error messages for cert uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonopono123 committed Nov 19, 2024
1 parent df6660e commit 65eb253
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/app/shared/validators/custom-form-validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 65eb253

Please sign in to comment.