Skip to content

Conversation

@Kosei805
Copy link
Contributor

やったこと

  • やったこと (コミットのハッシュ)
  • ユーザー情報を入力するフォームを実装した 3b0b574
  • ユーザー情報をフォームに初期値として入力しておくloaderを実装した 0bbe7a4
  • フォームのバリデーションを修正した 0bbe7a4
  • ユーザー情報を修正するactionを実装した 0bbe7a4

確認した方法

  • pnpm run devを使い、ユーザー情報を更新して確認した

スクリーンショット

image

自動生成したコード

  • ファイル名

@Kosei805 Kosei805 added the frontend frontend development label Nov 19, 2024
@Kosei805 Kosei805 requested a review from kimurash November 19, 2024 13:59
@Kosei805 Kosei805 self-assigned this Nov 19, 2024
Comment on lines 166 to 204
)
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;
Copy link
Member

Choose a reason for hiding this comment

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

ブロックにした方がいいと思った
newPasswordAgain のバリデーションも同様

Copy link
Contributor Author

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('新しいパスワードが一致しません');
Copy link
Member

Choose a reason for hiding this comment

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

「一致していません」の方がいいと思った

@Kosei805 Kosei805 merged commit 0fd5f9b into main Nov 19, 2024
3 checks passed
@Kosei805 Kosei805 deleted the 146-me-edit-page branch November 19, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend frontend development

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ユーザー編集ページの実装

3 participants