Skip to content

Commit

Permalink
return call for all memberships properly, change event bus log to inf…
Browse files Browse the repository at this point in the history
…o-level (#37)
  • Loading branch information
jacobsee authored Aug 11, 2023
1 parent 16270f6 commit 0cb8761
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/eventbus/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c *Client) Publish(_ context.Context, sub string, event *events.Event) err

subject := c.prefix + "." + sub

c.logger.Debug("publishing event on subject", zap.String("subject", subject), zap.Any("event", event))
c.logger.Info("publishing event to the event bus", zap.String("subject", subject), zap.Any("action", event.Action))

j, err := json.Marshal(event)
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions pkg/api/v1alpha1/group_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ func (r *Router) getGroupMembershipsAll(c *gin.Context) {
qm.Load("Group"),
}

var response []string
var response []GroupMembership

if _, ok := c.GetQuery("expired"); ok {
queryMods = append(queryMods, qm.Where("expires_at <= NOW()"))
Expand All @@ -1246,7 +1246,7 @@ func (r *Router) getGroupMembershipsAll(c *gin.Context) {
}
}

response := make([]GroupMembership, len(groupMemberships))
response = make([]GroupMembership, len(groupMemberships))
for i, m := range groupMemberships {
response[i] = GroupMembership{
ID: m.ID,
Expand All @@ -1265,7 +1265,8 @@ func (r *Router) getGroupMembershipsAll(c *gin.Context) {
return
}
}
response := make([]GroupMembership, len(enumeratedMemberships))

response = make([]GroupMembership, len(enumeratedMemberships))
for i, m := range enumeratedMemberships {
response[i] = GroupMembership{
ID: "",
Expand Down

0 comments on commit 0cb8761

Please sign in to comment.