(
Path(id): Path<String>,
Json(req): Json<UpdateProjectRequest>,
)
| 3333 | } |
| 3334 | |
| 3335 | async fn update_project( |
| 3336 | Path(id): Path<String>, |
| 3337 | Json(req): Json<UpdateProjectRequest>, |
| 3338 | ) -> Result<Json<ProjectInfo>> { |
| 3339 | let current = current_project_info().await?; |
| 3340 | if id != current.id { |
| 3341 | return Err(ApiError::NotFound(format!("Project not found: {}", id))); |
| 3342 | } |
| 3343 | |
| 3344 | let mut metadata = PROJECT_METADATA.write().await; |
| 3345 | let entry = metadata.entry(id).or_default(); |
| 3346 | if let Some(name) = req.name { |
| 3347 | entry.name = Some(name); |
| 3348 | } |
| 3349 | if let Some(icon) = req.icon { |
| 3350 | entry.icon = Some(icon); |
| 3351 | } |
| 3352 | drop(metadata); |
| 3353 | |
| 3354 | Ok(Json(current_project_info().await?)) |
| 3355 | } |
| 3356 | |
| 3357 | fn pty_routes() -> Router<Arc<ServerState>> { |
| 3358 | Router::new() |
nothing calls this directly
no test coverage detected