(
State(state): State<Arc<ServerState>>,
Path((session_id, msg_id)): Path<(String, String)>,
)
| 1113 | } |
| 1114 | |
| 1115 | async fn delete_message( |
| 1116 | State(state): State<Arc<ServerState>>, |
| 1117 | Path((session_id, msg_id)): Path<(String, String)>, |
| 1118 | ) -> Result<Json<serde_json::Value>> { |
| 1119 | let mut sessions = state.sessions.lock().await; |
| 1120 | let session = sessions |
| 1121 | .get_mut(&session_id) |
| 1122 | .ok_or_else(|| ApiError::SessionNotFound(session_id.clone()))?; |
| 1123 | session.remove_message(&msg_id); |
| 1124 | drop(sessions); |
| 1125 | persist_sessions_if_enabled(&state).await; |
| 1126 | Ok(Json(serde_json::json!({ "deleted": true }))) |
| 1127 | } |
| 1128 | |
| 1129 | #[derive(Debug, Deserialize)] |
| 1130 | pub struct AddPartRequest { |
nothing calls this directly
no test coverage detected