-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix/issue 400 #461
Fix/issue 400 #461
Conversation
そもそもフロント側が |
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.
レビューしました
router/presentation/query.go
Outdated
@@ -38,6 +39,8 @@ func GetUserRelationQuery(values url.Values) UserRelation { | |||
return RelationBelongs | |||
case "admins": | |||
return RelationAdmins | |||
case "belongsoradmins": |
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.
URLに指定するのでbelongs-or-adminsの方がいいかな
openapiにも追記してもらえると助かります:pray:
router/presentation/query.go
Outdated
@@ -38,6 +39,8 @@ func GetUserRelationQuery(values url.Values) UserRelation { | |||
return RelationBelongs | |||
case "admins": | |||
return RelationAdmins | |||
case "belongsoradmins": | |||
return RelationBelongsOrAdmins | |||
} | |||
|
|||
return RelationBelongs |
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.
デフォルトをどうするかも考慮したい
個人的にはRelationBelongsOrAdminsが自然な気がします
router/groups.go
Outdated
for id := range uniqueIDs { | ||
groupIDs = append(groupIDs, 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.
最後の空行は消してもらえると助かります:pray:
router/groups.go
Outdated
for _, id := range belongingGroupIDs { | ||
uniqueIDs[id] = struct{}{} | ||
} | ||
|
||
for _, id := range adminGroupIDs { | ||
uniqueIDs[id] = struct{}{} | ||
} | ||
|
||
for id := range uniqueIDs { | ||
groupIDs = append(groupIDs, 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.
allGroupIDs := append(belongingGroupIDs, adminGroupIDs)
uniqueIDMap := make(map[uuid.UUID]struct{})
uniqueIDs := make([]uuid.UUID, 0, len(allGroupIDs))
for _, id := range allGroupIDs {
if _, ok := uniqueIDMap[id]; ok {
continue
}
uniqueIDMap[id] = struct{}{}
uniqueIDs = append(uniqueIDs, id)
}
みたいに書けそうです:eyes:
これは新しいパラメータを作っていいと思います! |
遅くなりました. |
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.
いくつか書きました
docs/swagger.yaml
Outdated
description: どのような関係性でユーザーと結びつけるか。 | ||
|取り得る値は、admins(ユーザーが管理者), belongs(ユーザーが所属している), belongs-or-admins(ユーザーが管理者または所属している) | ||
|イベントはさらに、attendees(not absent) | ||
|値がない場合は、belongs として振る舞う |
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.
description: |
だけで複数行かけるのでそれでいいはず
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.
イベントはさらに、、の行言ってること分かりにくいけど思い出したら別PRで書き換えときます
router/presentation/query.go
Outdated
RelationBelongs = iota | ||
RelationAdmins = iota | ||
RelationBelongsOrAdmins = iota |
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.
RelationBelongs = iota | |
RelationAdmins = iota | |
RelationBelongsOrAdmins = iota | |
RelationBelongs UserRelation = iota | |
RelationAdmins | |
RelationBelongsOrAdmins |
かも?今のままだとuntyped intとかになってそう
遅くなりました. |
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.
見逃してました 🙇
よさそうです!
No description provided.