Skip to content

Commit

Permalink
Update events_persister.go
Browse files Browse the repository at this point in the history
Signed-off-by: Mohd Uzair <muzair.shaikh810@gmail.com>
  • Loading branch information
MUzairS15 authored Sep 12, 2023
1 parent 6c8a82b commit 4535cb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/models/events_persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ type CountBySeverityLevel struct {
func (e *EventsPersister) GetEventTypes(userID uuid.UUID) (map[string]interface{}, error) {
eventTypes := make(map[string]interface{}, 2)
var categories, actions []string
err := e.DB.Table("events").Distinct("category").Find(&categories).Error
err := e.DB.Table("events").Distinct("category").Where("user_id = ?", userID).Find(&categories).Error
if err != nil {
return nil, err
}

eventTypes["category"] = categories
err = e.DB.Table("events").Distinct("action").Find(&actions).Error
err = e.DB.Table("events").Distinct("action").Where("user_id = ?", userID).Find(&actions).Error
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 4535cb9

Please sign in to comment.