(
State(state): State<Arc<ServerState>>,
Json(patch): Json<AppConfig>,
)
| 2422 | } |
| 2423 | |
| 2424 | async fn patch_config( |
| 2425 | State(state): State<Arc<ServerState>>, |
| 2426 | Json(patch): Json<AppConfig>, |
| 2427 | ) -> Result<Json<AppConfig>> { |
| 2428 | let mut config = CONFIG_STATE.write().await; |
| 2429 | config.merge(patch); |
| 2430 | let updated = config.clone(); |
| 2431 | state.broadcast( |
| 2432 | &serde_json::json!({ |
| 2433 | "type": "config.updated", |
| 2434 | }) |
| 2435 | .to_string(), |
| 2436 | ); |
| 2437 | Ok(Json(updated)) |
| 2438 | } |
| 2439 | |
| 2440 | #[derive(Debug, Serialize)] |
| 2441 | pub struct ConfigProvidersResponse { |