Skip to content

Commit

Permalink
Merge pull request #6419 from NMDSdevopsServiceAdm/fix/upload-cert-er…
Browse files Browse the repository at this point in the history
…ror-message-priority

swapped the priority of the error messages for cert uploads
  • Loading branch information
Jonopono123 authored Nov 20, 2024
2 parents 98624ad + 65eb253 commit fa8e46c
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 fa8e46c

Please sign in to comment.