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