Split the Dashboard from All Tasks. (#10)

Reviewed-on: #10
Co-authored-by: Drew Galbraith <drew@tiramisu.one>
Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
Drew 2025-09-24 01:02:23 +00:00 committed by Drew
parent b0916990fb
commit 8e6ac03f70
10 changed files with 572 additions and 23 deletions

View file

@ -94,6 +94,15 @@ impl TaskModel {
.await?;
Ok(tasks)
}
pub async fn list_by_status(pool: &SqlitePool, status: TaskStatus) -> Result<Vec<TaskModel>> {
let tasks =
sqlx::query_as("SELECT * FROM tasks t WHERE t.status = $1 ORDER BY created_at DESC")
.bind(status)
.fetch_all(pool)
.await?;
Ok(tasks)
}
}
#[cfg(test)]