Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-#301: Now Error messages are displaying below input field as message error instead of toast error. #303

Merged
merged 3 commits into from
May 19, 2024

Conversation

0xmohitsen
Copy link
Contributor

@0xmohitsen 0xmohitsen commented May 19, 2024

Summary

This PR aims to achieve the #301 proposed enhancement for better user experience.

Description

This PR basically made correction in both frontend and backend.

Backend :-

  1. Changed in /signup handler
  2. Added some constant user response messages

Frontend :-

  1. Added setError method to display the error message below the input fields instead of toast error in both signin and signup page.
  2. Removed unnecessary validation from types.ts file in signup schema for confirmPassword.

Issue(s) Addressed

Closes : #301

Prerequisites

Copy link

vercel bot commented May 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wanderlust ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2024 3:43pm
wanderlust-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2024 3:43pm

@0xmohitsen
Copy link
Contributor Author

0xmohitsen commented May 19, 2024

@krishnaacharyaa sir what is wrong with the PR title or with commit message?

@krishnaacharyaa
Copy link
Owner

@0xmohitsen
We don't have enhance in the tags
image

Use feat instead or refactor

@krishnaacharyaa
Copy link
Owner

@Sukomal07 need your review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you just increase database call. You don't need to call DB again and again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah correct. I will make it in one db call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@0xmohitsen 0xmohitsen changed the title enhance-#301: Now Error messages are displaying below input field as message error instead of toast error. feat-#301: Now Error messages are displaying below input field as message error instead of toast error. May 19, 2024
@0xmohitsen
Copy link
Contributor Author

@0xmohitsen We don't have enhance in the tags image

Use feat instead or refactor

Rebased with feat but still PR title check is failed.

@krishnaacharyaa
Copy link
Owner

@0xmohitsen We don't have enhance in the tags image
Use feat instead or refactor

Rebased with feat but still PR title check is failed.

Forget it

@krishnaacharyaa
Copy link
Owner

@Sukomal07 good to merge?

@0xmohitsen
Copy link
Contributor Author

@Sukomal07 good to merge?

@krishnaacharyaa sir add the gssoc + level label too.

@Sukomal07
Copy link
Contributor

@krishnaacharyaa yes sir

@krishnaacharyaa krishnaacharyaa added gssoc Issue can be taken under GSSoC level2 labels May 19, 2024
passwordRegex,
'Password must be contains at least one uppercase and one lowercase and one digit and one special character'
),
.min(1, { message: 'Confirm Password is required'}),
})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 1? and why are we completely changing this? passwordRegex is totally removed?

Copy link
Contributor Author

@0xmohitsen 0xmohitsen May 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 1? and why are we completely changing this? passwordRegex is totally removed?

Given 1 so that if it is empty then we can show error message "Confirm Password is required".
And if it has at least 1 charactor in confirmPassword field it should check with password field string that confirmPassword and password field string matches or not so in this case it will show error message "Confirm Password does not match" if strings do not match.

And if confirmPassword string matches with password string then it won't show error message.

Password regex is removed (from confirmPassword field) because it does not require here. We are already added regex to password field so it is obivous that user will have to fill same password string in confirmPassword. We don't need to tell explicity for this field.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good attention to details!

@krishnaacharyaa krishnaacharyaa merged commit 5a6a520 into krishnaacharyaa:main May 19, 2024
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc Issue can be taken under GSSoC level2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Error messages should come below input field as message error instead of toast error.
3 participants