Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

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.

2 participants