Task filters #243

Merged
konrad merged 18 commits from feature/task-filter into master 2020-04-11 14:20:34 +00:00
2 changed files with 9 additions and 17 deletions
Showing only changes of commit 15138b8e30 - Show all commits

View File

@ -20,7 +20,6 @@ import (
"code.vikunja.io/api/pkg/timeutil"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web"
"time"
)
// Label represents a label
@ -212,10 +211,8 @@ func getUserTaskIDs(u *user.User) (taskIDs []int64, err error) {
}
tasks, _, _, err := getRawTasksForLists(lists, &taskOptions{
startDate: time.Unix(0, 0),
endDate: time.Unix(0, 0),
page: -1,
perPage: 0,
page: -1,
perPage: 0,
})
if err != nil {
return nil, err

View File

@ -20,15 +20,12 @@ package models
import (
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web"
"time"
)
// TaskCollection is a struct used to hold filter details and not clutter the Task struct with information not related to actual tasks.
type TaskCollection struct {
ListID int64 `param:"list"`
StartDateSortUnix int64 `query:"startdate"`
EndDateSortUnix int64 `query:"enddate"`
Lists []*List
ListID int64 `param:"list"`
Lists []*List
// The query parameter to sort by. This is for ex. done, priority, etc.
SortBy []string `query:"sort_by"`
@ -163,13 +160,11 @@ func (tf *TaskCollection) ReadAll(a web.Auth, search string, page int, perPage i
}
taskopts := &taskOptions{
search: search,
startDate: time.Unix(tf.StartDateSortUnix, 0),
endDate: time.Unix(tf.EndDateSortUnix, 0),
page: page,
perPage: perPage,
sortby: sort,
filters: filters,
search: search,
page: page,
perPage: perPage,
sortby: sort,
filters: filters,
}
shareAuth, is := a.(*LinkSharing)