Skip to content

Commit

Permalink
Merge pull request #545 from Studio-Yandex-Practicum/fix-form-psevdonim
Browse files Browse the repository at this point in the history
fix: добавление исключений валидации формы v2
  • Loading branch information
AntonZelinsky authored May 19, 2024
2 parents b4c0ff4 + 36fd10f commit b597ad2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/pages/form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ const validate = (values: ParticipationFormFields) => {
errors.email = errorMessage.incorrectEmail;
}

if (!values.nickname.length && values.anonym) {
errors.nickname = errorMessage.empty;
} else if (values.nickname.length && values.nickname.length < 3) {
if (values.nickname.length && values.nickname.length < 3) {
errors.nickname = errorMessage.minLenghThree;
} else if (values.nickname.length > 30) {
errors.nickname = errorMessage.maxLengthThirty;
Expand Down

0 comments on commit b597ad2

Please sign in to comment.