MCPcopy Create free account
hub / github.com/actix/examples / toggle_task

Function toggle_task

basics/todo/src/db.rs:24–29  ·  view source on GitHub ↗
(id: i32, pool: &SqlitePool)

Source from the content-addressed store, hash-verified

22}
23
24pub 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
31pub async fn delete_task(id: i32, pool: &SqlitePool) -> Result<(), &'static str> {
32 Task::delete_with_id(id, pool)

Callers 1

toggleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected