(
State(state): State<Arc<ServerState>>,
Path(session_id): Path<String>,
)
| 1096 | } |
| 1097 | |
| 1098 | async fn list_messages( |
| 1099 | State(state): State<Arc<ServerState>>, |
| 1100 | Path(session_id): Path<String>, |
| 1101 | ) -> Result<Json<Vec<MessageInfo>>> { |
| 1102 | let sessions = state.sessions.lock().await; |
| 1103 | let session = sessions |
| 1104 | .get(&session_id) |
| 1105 | .ok_or_else(|| ApiError::SessionNotFound(session_id.clone()))?; |
| 1106 | Ok(Json( |
| 1107 | session |
| 1108 | .messages |
| 1109 | .iter() |
| 1110 | .map(|m| message_to_info(&session_id, m)) |
| 1111 | .collect(), |
| 1112 | )) |
| 1113 | } |
| 1114 | |
| 1115 | async fn delete_message( |
| 1116 | State(state): State<Arc<ServerState>>, |
nothing calls this directly
no test coverage detected