(
store: Store,
params: HashMap<String, String>,
)
| 8 | }; |
| 9 | |
| 10 | pub async fn add_answer( |
| 11 | store: Store, |
| 12 | params: HashMap<String, String>, |
| 13 | ) -> Result<impl warp::Reply, warp::Rejection> { |
| 14 | let answer = Answer { |
| 15 | id: AnswerId("1".to_string()), |
| 16 | content: params.get("content").unwrap().to_string(), |
| 17 | question_id: QuestionId(params.get("questionId").unwrap().to_string()), |
| 18 | }; |
| 19 | |
| 20 | store.answers.write().await.insert(answer.id.clone(), answer); |
| 21 | |
| 22 | Ok(warp::reply::with_status("Answer added", StatusCode::OK)) |
| 23 | } |
nothing calls this directly
no test coverage detected