Skip to content

Conversation

@Kubosaka
Copy link
Collaborator

#101

resolve #0

概要

  • ユーザの修正ページで削除ができるようにした。
  • 戻るボタンの色の修正

画面スクリーンショット等

  • URL
スクリーンショット 2023-08-15 15 25 18

テスト項目

  • 修正ページからユーザの削除ができるか確認する

備考

@Kubosaka Kubosaka self-assigned this Aug 15, 2023
@vercel
Copy link

vercel bot commented Aug 15, 2023

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

Name Status Preview Updated (UTC)
chosei-chan ✅ Ready (Inspect) Visit Preview Aug 15, 2023 6:27am
chosei-chan-rom4 ✅ Ready (Inspect) Visit Preview Aug 15, 2023 6:27am

@github-actions github-actions bot added the enhancement New feature or request label Aug 15, 2023
Copy link
Collaborator

@imaimai17468 imaimai17468 left a comment

Choose a reason for hiding this comment

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

動作は問題なし!
ちょっと改良できそうな部分をレビューしました

const users: User[] = schedule.users || [{ name: '', memo: '', availables: null }]
try {
await deleteUser(props.id, users[user_id])
await router.push('/' + props.id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

したみたいにすると、指定したdynamic routeのqueryに対して正確な値を入れることができるので、ただの文字列の足し算から生まれるバグとか曖昧さを消すことができる、おすすめ

Suggested change
await router.push('/' + props.id)
await router.push({
pathname: '/[scheduleId]',
query: {
scheduleId: props.id
}
}
)

Comment on lines +77 to +78
try {
await deleteUser(props.id, users[user_id])
Copy link
Collaborator

Choose a reason for hiding this comment

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

せっかくawait文を使ってるので、できればtry...catchではなく、await...then...catchがいいかな
参考:https://nut-m-e-g.slack.com/archives/C029KG3MAS3/p1691693711905709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants