feat(alle opgaver): et endepunkt med alle åbne opgaver
GET /api/v1/all-tasks: hver åben opgave på øverste niveau i hvert aktivt projekt, man kan se. Arkiverede projekter er udeladt, underopgaver vises som deres forælders tal. Højst 2000, og svaret siger det, når der var flere. Og en kalendertest, der var blevet rød på main: dens begivenhed lå fast på 20. august, og vinduet holder 90 dage tilbage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f578dee45f
commit
6dba7ab60a
@@ -69,7 +69,12 @@ type TaskFilter struct {
|
||||
// TopLevelOnly excludes sub-tasks, which a project view wants because it
|
||||
// renders them nested under their parents rather than as separate rows.
|
||||
TopLevelOnly bool
|
||||
AssigneeID string
|
||||
// ActiveProjectsOnly leaves out tasks in archived projects. An archived
|
||||
// project is one somebody put away; its open tasks are not work that is
|
||||
// waiting, and a view of "everything I have to do" that fills up with them is
|
||||
// a view that has to be read past.
|
||||
ActiveProjectsOnly bool
|
||||
AssigneeID string
|
||||
// DelegatedBy is the other side of AssigneeID: assigned, but not to this
|
||||
// person. A second field rather than a magic value in AssigneeID, because the
|
||||
// two are different questions — "what is on my plate" and "what have I handed
|
||||
@@ -140,6 +145,9 @@ func (db *DB) ListTasks(ctx context.Context, userID string, f TaskFilter) ([]Tas
|
||||
if f.TopLevelOnly {
|
||||
where = append(where, `t.parent_id IS NULL`)
|
||||
}
|
||||
if f.ActiveProjectsOnly {
|
||||
where = append(where, `p.archived = 0`)
|
||||
}
|
||||
if f.AssigneeID != "" {
|
||||
where = append(where, `t.assignee_id = ?`)
|
||||
args = append(args, f.AssigneeID)
|
||||
|
||||
Reference in New Issue
Block a user