Skip to content

Commit

Permalink
Merge pull request #175 from traPtitech/develop
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
fuji8 committed May 23, 2021
2 parents 5cffe04 + 8d9c022 commit 1d70db8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ components:
値がない場合は、belongs として振る舞う
schema:
type: string
example:
enum:
- admins
- belongs

Expand Down
9 changes: 9 additions & 0 deletions usecase/production/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func createUserMap(users []*domain.User) map[uuid.UUID]*domain.User {
return userMap
}

// add traQ group and traP(111...)
func addTraQGroupIDs(repo *Repository, userID uuid.UUID, expr filter.Expr) filter.Expr {
t, err := repo.GormRepo.GetToken(userID)
if err != nil {
Expand All @@ -195,6 +196,14 @@ func addTraQGroupIDs(repo *Repository, userID uuid.UUID, expr filter.Expr) filte
if err != nil {
return e
}
// add traP
user, err := repo.GormRepo.GetUser(id)
if err != nil {
return e
}
if user.Provider.Issuer == traQIssuerName {
groupIDs = append(groupIDs, traPGroupID)
}
return &filter.LogicOpExpr{
LogicOp: filter.Or,
Lhs: e,
Expand Down

0 comments on commit 1d70db8

Please sign in to comment.