Skip to content

Commit

Permalink
rename schemas to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrov-site committed May 17, 2024
1 parent a17cdb0 commit c6d6f4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/modals/NewChannel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const NewChannel = () => {
const { data: channels = [], refetch: refetchChannels } = useGetChannelsQuery();
const [addChannel] = useAddChannelMutation();
const channelsNames = channels.map((channel) => channel.name);
const ChannelNameSchema = Yup.object().shape({
const channelNameSchema = Yup.object().shape({
channelName: Yup.string().notOneOf(channelsNames, t('form.errors.channelExists')).min(3, t('form.errors.range')).max(20, t('form.errors.range'))
.required(t('form.errors.required')),
});
Expand Down Expand Up @@ -46,7 +46,7 @@ const NewChannel = () => {
<Formik
initialValues={{ channelName: '' }}
onSubmit={handleFormSubmit}
validationSchema={ChannelNameSchema}
validationSchema={channelNameSchema}
>
{({
values, handleChange, handleSubmit, errors,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/modals/RenameChannel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const RenameChannel = () => {
const modalChannelName = useSelector((state) => state.app.modalChannelName);
const { data: channels = [], refetch: refetchChannels } = useGetChannelsQuery();
const channelsNames = channels.map((channel) => channel.name);
const ChannelNameSchema = Yup.object().shape({
const channelNameSchema = Yup.object().shape({
channelName: Yup.string().notOneOf(channelsNames, t('form.errors.channelExists')).min(3, t('form.errors.range')).max(20, t('form.errors.range'))
.required(t('form.errors.required')),
});
Expand Down Expand Up @@ -46,7 +46,7 @@ const RenameChannel = () => {
<Modal.Body>
<Formik
initialValues={{ channelName: modalChannelName, channelId: modalChannelId }}
validationSchema={ChannelNameSchema}
validationSchema={channelNameSchema}
onSubmit={renameChannel}
>
{({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Signup = () => {
const navigate = useNavigate();
const dispatch = useDispatch();
const [signup] = useSignupMutation();
const SignupSchema = Yup.object().shape({
const signupSchema = Yup.object().shape({
nickname: Yup.string().required(t('form.errors.required')).min(3, t('form.errors.range')).max(20, t('form.errors.range')),
password: Yup.string().required(t('form.errors.required')).min(6, t('form.errors.min')),
passwordConfirm: Yup.string().required(t('form.errors.required')).oneOf([Yup.ref('password'), null], t('form.errors.passwordMustMatch')),
Expand Down Expand Up @@ -63,7 +63,7 @@ const Signup = () => {
<Formik
initialValues={{ nickname: '', password: '', passwordConfirm: '' }}
onSubmit={handleFormSubmit}
validationSchema={SignupSchema}
validationSchema={signupSchema}
validateOnChange={false}
>
{({
Expand Down

0 comments on commit c6d6f4e

Please sign in to comment.