(
State(state): State<Arc<ServerState>>,
Path(id): Path<String>,
)
| 505 | } |
| 506 | |
| 507 | async fn share_session( |
| 508 | State(state): State<Arc<ServerState>>, |
| 509 | Path(id): Path<String>, |
| 510 | ) -> Result<Json<SessionShareInfo>> { |
| 511 | let mut sessions = state.sessions.lock().await; |
| 512 | let share_url = format!("https://share.opencode.ai/{}", id); |
| 513 | sessions |
| 514 | .share(&id, share_url.clone()) |
| 515 | .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?; |
| 516 | drop(sessions); |
| 517 | persist_sessions_if_enabled(&state).await; |
| 518 | Ok(Json(SessionShareInfo { url: share_url })) |
| 519 | } |
| 520 | |
| 521 | async fn unshare_session( |
| 522 | State(state): State<Arc<ServerState>>, |
nothing calls this directly
no test coverage detected