From 4535cb9f7b40a68e9ff1397b91b1b26d57475652 Mon Sep 17 00:00:00 2001 From: Mohd Uzair Date: Tue, 12 Sep 2023 06:09:57 +0530 Subject: [PATCH] Update events_persister.go Signed-off-by: Mohd Uzair --- server/models/events_persister.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }