Skip to content

Commit

Permalink
fix: change regex for AddMeetingForm. Resolve #44
Browse files Browse the repository at this point in the history
  • Loading branch information
AnaSerg committed Aug 2, 2023
1 parent 894d142 commit 4cd5252
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AddMeetingForm = ({closePopup, userId, handleAddMeetingInfo, update
const [moodStates] = useRequest(() => getMentalStates());
const [disabledButton, setDisabledButton] = useState<boolean>(true);

const regex = /^[\w\s\d\x20-\x7EА-Яа-яЁё]{2,256}$/;
const regex = /^[а-яА-Яa-zA-Z0-9\s!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]*$/;

useEffect(() => {
if(value && selectedDate && comment && !commentError) {
Expand Down Expand Up @@ -81,7 +81,7 @@ export const AddMeetingForm = ({closePopup, userId, handleAddMeetingInfo, update
setCommentError("Максимальное количество символов: 256");
setDisabledButton(true);
} else if (!regex.test(value)) {
setCommentError("");
setCommentError("Можно вводить только заглавные и строчные буквы русского и английского алфавита, цифры, символы и пробелы.");
setDisabledButton(true);
} else {
setCommentError("");
Expand Down

0 comments on commit 4cd5252

Please sign in to comment.