Feature Request: Implement Zod Validation on Registration Form
Description
This task aims to implement form validation using Zod with react-hook-form and @hookform/resolvers on the registration form. The goal is to ensure the form data is validated properly before submission.
Tasks
Navigate to the frontend folder using this command
cd frontend
Install Dependencies:
Install react-hook-form, @hookform/resolvers, and zod using npm.
Create a Zod schema for the registration form validation.
Integrate the Zod schema with react-hook-form using @hookform/resolvers.
Update Registration Component:
Update the existing registration component to use react-hook-form for handling form state and validation.
Additional Notes
Branch: Please create a new branch from development for your changes.
git checkout development
git pull origin development
git checkout -b feature/setup-zod-validation
Pull Request: Submit a pull request to merge your changes into development.
Testing: Ensure the form validation works correctly by providing appropriate feedback for invalid inputs
Guidelines to Follow:
Create Zod Schema:
Use the following code as a starting point to create a Zod schema for the registration form:
// zodSchemas.ts
import * as z from 'zod';
export const registerSchema = z.object({
name: z.string().min(1, 'Full name is required'),
username: z.string().min(1, 'Username is required'),
email: z.string().email('Invalid email address'),
password: z.string().min(6, 'Password must be at least 6 characters long'),
});
Feature Request: Implement Zod Validation on Registration Form
Description
This task aims to implement form validation using Zod with
react-hook-form
and@hookform/resolvers
on the registration form. The goal is to ensure the form data is validated properly before submission.Tasks
Navigate to the frontend folder using this command
Install Dependencies:
react-hook-form
,@hookform/resolvers
, andzod
using npm.Set Up Zod Validation:
react-hook-form
using@hookform/resolvers
.Update Registration Component:
react-hook-form
for handling form state and validation.Additional Notes
Branch: Please create a new branch from
development
for your changes.Pull Request: Submit a pull request to merge your changes into
development
.Testing: Ensure the form validation works correctly by providing appropriate feedback for invalid inputs
Guidelines to Follow:
Create Zod Schema:
export const registerSchema = z.object({ name: z.string().min(1, 'Full name is required'), username: z.string().min(1, 'Username is required'), email: z.string().email('Invalid email address'), password: z.string().min(6, 'Password must be at least 6 characters long'), });