MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / delete_question

Function delete_question

ch_06/src/routes/question.rs:43–53  ·  view source on GitHub ↗
(
    id: String,
    store: Store,
)

Source from the content-addressed store, hash-verified

41}
42
43pub async fn delete_question(
44 id: String,
45 store: Store,
46) -> Result<impl warp::Reply, warp::Rejection> {
47 match store.questions.write().await.remove(&QuestionId(id)) {
48 Some(_) => (),
49 None => return Err(warp::reject::custom(Error::QuestionNotFound)),
50 }
51
52 Ok(warp::reply::with_status("Question deleted", StatusCode::OK))
53}
54
55pub async fn add_question(
56 store: Store,

Callers

nothing calls this directly

Calls 1

QuestionIdClass · 0.50

Tested by

no test coverage detected