Function
delete_question
(
id: String,
store: Store,
)
Source from the content-addressed store, hash-verified
| 35 | } |
| 36 | |
| 37 | pub 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 | |
| 49 | pub async fn add_question( |
| 50 | store: Store, |
Callers
nothing calls this directly
Tested by
no test coverage detected