diff --git a/server/models/events_persister.go b/server/models/events_persister.go index 1252bc3761b..eff5422c5b9 100644 --- a/server/models/events_persister.go +++ b/server/models/events_persister.go @@ -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 }