Skip to content

Commit 43e4165

Browse files
committed
fix(controlplane): apply owner_id replacements to base used in query (ineffassign)
1 parent e18662d commit 43e4165

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

database/postgres/event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,12 @@ func (e *eventRepo) LoadEventsPaged(ctx context.Context, projectID string, filte
596596
}
597597
query = fmt.Sprintf(existsPagination, baseEventsPagedExists, filterQueryNoEndpoint, existsSubquery, preOrder, filter.Pageable.SortOrder(), preOrder, filter.Pageable.SortOrder())
598598
} else {
599+
base = baseEventsSearch
599600
if len(filter.OwnerID) == 0 {
600601
base = strings.Replace(base, "with endpoint_ids as (select id from convoy.endpoints where owner_id = :owner_id),", "with ", 1)
601602
base = strings.Replace(base, "endpoint_ids", "convoy.endpoints", 1)
602603
}
603604
filterQuery += searchFilter
604-
base = baseEventsSearch
605605
query = fmt.Sprintf(baseQueryPagination, base, filterQuery, preOrder, filter.Pageable.SortOrder(), preOrder, filter.Pageable.SortOrder())
606606
}
607607
query, args, err = sqlx.Named(query, arg)

0 commit comments

Comments
 (0)