(id: i32, pool: &SqlitePool)
| 22 | } |
| 23 | |
| 24 | pub async fn toggle_task(id: i32, pool: &SqlitePool) -> Result<(), &'static str> { |
| 25 | Task::toggle_with_id(id, pool) |
| 26 | .await |
| 27 | .map(|_| ()) |
| 28 | .map_err(|_| "Error toggling task completion") |
| 29 | } |
| 30 | |
| 31 | pub async fn delete_task(id: i32, pool: &SqlitePool) -> Result<(), &'static str> { |
| 32 | Task::delete_with_id(id, pool) |