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

refactor: Refactor validation in SignUp.jsx #381

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

nikohoffren
Copy link
Contributor

Changes:

  • Replaced if-else conditions with a for loop to check for empty fields.
  • Mapped error messages to their respective fields in an array to reduce code repetition.
  • Improved the readability of the validation logic in the signup function.

The new implementation is cleaner and easier to read and the changes reduce the amount of repeated code.
Also future modifications to the fields or the error messages can be easily handled by updating the array, improving the maintainability of the code. This solution should not affect the functionality of the code.

@royalpinto007 royalpinto007 merged commit 0df8582 into Stoccoin-Official:main Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants