[feat]ユーザの修正ページからユーザの削除#102
Open
Kubosaka wants to merge 2 commits into
Open
Conversation
added 2 commits
August 15, 2023 15:08
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
imaimai17468
requested changes
Aug 18, 2023
Collaborator
imaimai17468
left a comment
There was a problem hiding this comment.
動作は問題なし!
ちょっと改良できそうな部分をレビューしました
| const users: User[] = schedule.users || [{ name: '', memo: '', availables: null }] | ||
| try { | ||
| await deleteUser(props.id, users[user_id]) | ||
| await router.push('/' + props.id) |
Collaborator
There was a problem hiding this comment.
したみたいにすると、指定した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]) |
Collaborator
There was a problem hiding this comment.
せっかくawait文を使ってるので、できればtry...catchではなく、await...then...catchがいいかな
参考:https://nut-m-e-g.slack.com/archives/C029KG3MAS3/p1691693711905709
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#101
resolve #0
概要
画面スクリーンショット等
URLテスト項目
備考