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

Forgot/ResetPassword #6

Merged
merged 7 commits into from
Jul 24, 2022
Merged

Forgot/ResetPassword #6

merged 7 commits into from
Jul 24, 2022

Conversation

zahirekrem09
Copy link
Contributor

No description provided.

@zahirekrem09 zahirekrem09 requested a review from 7alip July 18, 2022 20:10
@vercel
Copy link

vercel bot commented Jul 18, 2022

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

Name Status Preview Updated
wsvvui ✅ Ready (Inspect) Visit Preview Jul 22, 2022 at 10:14PM (UTC)

Copy link
Contributor

@7alip 7alip left a comment

Choose a reason for hiding this comment

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

Thank you. I left a small comments about form fields type definition and removing commented out lines.

});

export type ForgotPasswordFormProps = {
onSubmitHandler: (data: FieldValues) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can declare ResetPasswordFieldValues to be used instead of FieldValues, so that we will able to see the field value types in the pages/components where we call onSubmit handler.

For example Strapi expect id as number but we might get the id as string from some forms. Type checking will guide us about type conversions in this case.

export type ResetPasswordFieldValues = {
  password: string;
  passwordConfirmation: string;
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this part was like you said normally, but since there were type errors in the errors and register props in the FormItem, I had to do it this way.

export type ResetPasswordFieldValues = {
  password: string;
  passwordConfirmation: string;
};

 const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm<ResetPasswordFieldValues>();

Copy link
Contributor

Choose a reason for hiding this comment

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

@zahirekrem09 Well, it makes sense then.

You can. maybe fix the lint issues and then merge it.

yarn lint or npx nx affected --target=lint --fix

@7alip 7alip mentioned this pull request Jul 22, 2022
46 tasks
@7alip 7alip changed the title forgot & reset password form Forgot/ResetPassword Jul 22, 2022
@zahirekrem09 zahirekrem09 merged commit 0aece9c into dev Jul 24, 2022
@7alip 7alip deleted the feat/forgot-password-form branch July 31, 2022 15:33
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