| 3650 | } |
| 3651 | |
| 3652 | async fn reject_question( |
| 3653 | State(state): State<Arc<ServerState>>, |
| 3654 | Path(id): Path<String>, |
| 3655 | ) -> Result<Json<bool>> { |
| 3656 | let mut pending = QUESTION_REQUESTS.write().await; |
| 3657 | let question = pending |
| 3658 | .remove(&id) |
| 3659 | .ok_or_else(|| ApiError::NotFound(format!("Question request not found: {}", id)))?; |
| 3660 | drop(pending); |
| 3661 | |
| 3662 | state.broadcast( |
| 3663 | &serde_json::json!({ |
| 3664 | "type": "question.rejected", |
| 3665 | "requestID": id, |
| 3666 | "sessionID": question.session_id, |
| 3667 | }) |
| 3668 | .to_string(), |
| 3669 | ); |
| 3670 | Ok(Json(true)) |
| 3671 | } |
| 3672 | |
| 3673 | /// TUI communication routes. |
| 3674 | /// |