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

Function delete_question

ch_05/src/routes/question.rs:37–47  ·  view source on GitHub ↗
(
    id: String,
    store: Store,
)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

QuestionIdClass · 0.50

Tested by

no test coverage detected