Conversation
| }; | ||
|
|
||
| const useUpdatePasswordMutation = ( | ||
| options?: MutationHookOptions<UpdatePasswordResponseData, UpdatePasswordRequestVariables>, |
There was a problem hiding this comment.
Should the options be optional for mutation?
There was a problem hiding this comment.
In this case it is required
|
|
||
| NewPasswordPage.getInitialProps = ({ res, accessTokenManager }) => { | ||
| if (accessTokenManager.accessToken) { | ||
| if (res) { |
There was a problem hiding this comment.
I don't know why, but in other files we use the following conditions if (!!req && !!res) {
There was a problem hiding this comment.
Now for all pages we check only res, so I think we can leave it
| return {}; | ||
| }; | ||
|
|
||
| export default withApolloClient(WithAuth(NewPasswordPage)); |
There was a problem hiding this comment.
Why don't you use WithAuthSecurity HOC?
There was a problem hiding this comment.
I think we can leave as is, cause almost all pages do not use this HOC. I'll take a look at this in next prs
|
|
||
| import { FieldWrapper, FormContentWrapper, SubmitButtonWrapper } from './styled'; | ||
|
|
||
| const passwordRegularExp = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])([0-9A-Za-z#$@&!?.*^{}<>;,)(~'"=_%+-]+)$/; |
There was a problem hiding this comment.
better create new file with all regexp
| .required('This field is required'), | ||
| }); | ||
|
|
||
| type ValuesFromFormik = { |
There was a problem hiding this comment.
rename ValuesFromFormik to FormValues. If we replace formik with another form, type of values should not change, as well as name of type
|
|
||
| const passwordRegularExp = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])([0-9A-Za-z#$@&!?.*^{}<>;,)(~'"=_%+-]+)$/; | ||
|
|
||
| const initialValues = { |
| @@ -0,0 +1,5 @@ | |||
| mutation UpdatePassword($input: UpdatePasswordInput!) { | |||
| updatePassword(input: $input) { | |||
| accessToken | |||
| @@ -0,0 +1,5 @@ | |||
| mutation UpdatePassword($input: UpdatePasswordInput!) { | |||
There was a problem hiding this comment.
Oyyy I didn't know what type for $input existed
Maybe better to rename all input type for mutation
There was a problem hiding this comment.
I'm sorry, but I don't understand your point. I think we can leave as is for now
| onCompleted, | ||
| }); | ||
|
|
||
| const mutate = async ({ password, resetToken }: UpdatePasswordProps) => { |
There was a problem hiding this comment.
UpdatePasswordProps should be named UpdatePasswordVariables from 'api/types...'
|
|
||
| import useUpdatePasswordMutation from 'api/mutations/update/useUpdatePasswordMutation'; | ||
|
|
||
| export type UpdatePasswordProps = { |
| const NewPasswordPage = ({ query }) => { | ||
| return ( | ||
| <NotifierProvider> | ||
| <DefaultTemplate testId="recovery-password-page"> |
There was a problem hiding this comment.
it is not recovery-password-page
|
|
||
| import UpdatePasswordMutation from 'graphql/mutations/updatePassword.graphql'; | ||
|
|
||
| import type { UpdatePasswordVariables, UpdatePasswordData } from '../../types/user/updatePasswordApiType'; |
There was a problem hiding this comment.
should be the absolute path
Summary
A brief description of the pull request.
Resolves: #138
Screenshots in case of UI changes
Review notes
While reviewing pull-request (especially when it's your pull-request), please make sure that:
.env.exampleand added to Heroku