-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feat]ユーザの修正ページからユーザの削除 #102
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
動作は問題なし!
ちょっと改良できそうな部分をレビューしました
const users: User[] = schedule.users || [{ name: '', memo: '', availables: null }] | ||
try { | ||
await deleteUser(props.id, users[user_id]) | ||
await router.push('/' + props.id) |
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.
したみたいにすると、指定したdynamic routeのqueryに対して正確な値を入れることができるので、ただの文字列の足し算から生まれるバグとか曖昧さを消すことができる、おすすめ
await router.push('/' + props.id) | |
await router.push({ | |
pathname: '/[scheduleId]', | |
query: { | |
scheduleId: props.id | |
} | |
} | |
) |
try { | ||
await deleteUser(props.id, users[user_id]) |
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.
せっかくawait文を使ってるので、できればtry...catchではなく、await...then...catchがいいかな
参考:https://nut-m-e-g.slack.com/archives/C029KG3MAS3/p1691693711905709
#101
resolve #0
概要
画面スクリーンショット等
URL
テスト項目
備考