feat: decouple views from projects #2217

Merged
konrad merged 97 commits from feature/decouple-views-from-projects into main 2024-03-19 19:16:14 +00:00
1 changed files with 6 additions and 1 deletions
Showing only changes of commit fa137b1ffc - Show all commits

View File

@ -261,8 +261,13 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
limit, start := getLimitFromPageIndex(opts.page, opts.perPage)
cond := builder.And(builder.Or(projectIDCond, favoritesCond), where, filterCond)
var distinct = "tasks.*"
if strings.Contains(orderby, "task_positions.") {
distinct += ", task_positions.position"
}
query := d.s.
Distinct("tasks.*").
Distinct(distinct).
Where(cond)
if limit > 0 {
query = query.Limit(limit, start)