Skip to content

Commit

Permalink
feature: fix for issue with getting events by resource id
Browse files Browse the repository at this point in the history
  • Loading branch information
akeemphilbert committed Sep 10, 2024
1 parent d2496ce commit 17b20a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (e *GORMEventStore) ResourceDeleteHandler(ctx context.Context, logger Log,

// GetByResourceID gets events by resource id
func (e *GORMEventStore) GetByResourceID(ctxt context.Context, logger Log, resourceID string) (events []*Event, err error) {
result := e.gormDB.Model(&Event{}).Where("meta.resource_id = ?", resourceID).Find(events)
result := e.gormDB.Model(&Event{}).Where("resource_id = ?", resourceID).Find(events)
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
logger.Errorf("error getting events for resource %s: %v", resourceID, result.Error)
err = result.Error
Expand Down

0 comments on commit 17b20a9

Please sign in to comment.