Skip to content

Commit

Permalink
Limit the answers length on ApplicationForm (#7419)
Browse files Browse the repository at this point in the history
* Limit the answers length on ApplicationForm

* Fix error message

---------

Co-authored-by: Petar Kolev <[email protected]>
  • Loading branch information
ccanos and reactoholic authored Jan 10, 2025
1 parent 3d34944 commit 010aa2e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ const ApplicationDialog = ({
questions.reduce(
(acc, val) =>
acc.shape({
[val.question]: val.required ? yup.string().required(t('forms.validations.required')) : yup.string(),
[val.question]: val.required
? yup.string().required(t('forms.validations.required')).max(val.maxLength, 'forms.validations.maxLength')
: yup.string().max(val.maxLength, 'forms.validations.maxLength'),
}),
yup.object()
),
Expand Down

0 comments on commit 010aa2e

Please sign in to comment.