1
0

Task collection improvements (#109)

This commit is contained in:
konrad
2019-12-01 13:38:11 +00:00
parent d96831fe3a
commit 7e4deab8f7
81 changed files with 44585 additions and 38569 deletions

View File

@ -117,7 +117,16 @@ const (
SortTasksByPriorityDesc
)
// ReadAll gets all tasks for a user
type taskOptions struct {
search string
sortby SortBy
startDate time.Time
endDate time.Time
page int
perPage int
}
// ReadAll is a dummy function to still have that endpoint documented
// @Summary Get tasks
// @Description Returns all tasks on any list the user has access to.
// @tags task
@ -134,21 +143,7 @@ const (
// @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/all [get]
func (t *Task) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) {
tc := &TaskCollection{
Sorting: t.Sorting,
StartDateSortUnix: t.StartDateSortUnix,
EndDateSortUnix: t.EndDateSortUnix,
}
return tc.ReadAll(a, search, page, perPage)
}
type taskOptions struct {
search string
sortby SortBy
startDate time.Time
endDate time.Time
page int
perPage int
return nil, 0, 0, nil
}
func getRawTasksForLists(lists []*List, opts *taskOptions) (taskMap map[int64]*Task, resultCount int, totalItems int64, err error) {