-
Notifications
You must be signed in to change notification settings - Fork 0
ユーザー情報編集ページの実装 #150
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
ユーザー情報編集ページの実装 #150
Conversation
| ) | ||
| return null; | ||
| else { | ||
| if (value) { | ||
| if (value.length < 8) | ||
| return 'パスワードは8文字以上で入力してください'; | ||
| else if (/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]+$/.test(value)) | ||
| return null; | ||
| else return 'パスワードにはアルファベットと数字を含めてください'; | ||
| } else return '現在のパスワードを入力してください'; | ||
| } | ||
| // パスワードフォームを触っていない | ||
| } else return null; | ||
| }, | ||
| newPassword: (value, values) => { | ||
| // パスワードを更新しようとしている | ||
| if (value || values.currentPassword || values.newPasswordAgain) { | ||
| // パスワードフォームが全て空文字列 | ||
| if ( | ||
| value === '' && | ||
| values.currentPassword === '' && | ||
| values.newPasswordAgain === '' | ||
| ) | ||
| return null; | ||
| else { | ||
| if (value) { | ||
| if (value.length < 8) | ||
| return 'パスワードは8文字以上で入力してください'; | ||
| else if (/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]+$/.test(value)) | ||
| if (values.currentPassword) { | ||
| if (value === values.currentPassword) | ||
| return 'パスワードが更新されていません'; | ||
| else return null; | ||
| } else return null; | ||
| else return 'パスワードにはアルファベットと数字を含めてください'; | ||
| } else return '新しいパスワードを入力してください'; | ||
| } | ||
| // パスワードフォームを触っていない | ||
| } else return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ブロックにした方がいいと思った
newPasswordAgain のバリデーションも同様
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おk
| ); | ||
| } else { | ||
| if (props.newPassword !== props.newPasswordAgain) { | ||
| errorNotification('新しいパスワードが一致しません'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「一致していません」の方がいいと思った
やったこと
確認した方法
pnpm run devを使い、ユーザー情報を更新して確認したスクリーンショット
自動生成したコード