refactor: remove manual refresh and search controls
ci / gitleaks (push) Successful in 8s
ci / docker (push) Successful in 7m17s

This commit is contained in:
2026-09-19 21:15:23 +08:00
parent 0cf1c49094
commit 4973d56a64
29 changed files with 244 additions and 860 deletions
-13
View File
@@ -1027,7 +1027,6 @@ async def create_task(
@app.get("/api/v1/tasks", response_model=TaskPage)
async def list_tasks(
q: str | None = None,
list_id: UUID | None = None,
completed: bool | None = None,
due_from: datetime | None = None,
@@ -1072,18 +1071,6 @@ async def list_tasks(
query = query.where(Task.completed_at >= completed_from)
if completed_to is not None:
query = query.where(Task.completed_at < completed_to)
if q:
pattern = f"%{q}%"
list_match = exists(
select(TaskList.id).where(
TaskList.id == Task.list_id,
TaskList.user_id == user.id,
TaskList.name.ilike(pattern),
)
)
query = query.where(
or_(Task.title.ilike(pattern), Task.description.ilike(pattern), list_match)
)
total = await db.scalar(select(func.count()).select_from(query.order_by(None).subquery())) or 0
ordering = _task_ordering()
if page is not None: