feat: add system configuration API endpoint and frontend hook for dynamic settings

This commit is contained in:
2025-12-25 23:41:00 +01:00
parent 529457c9a3
commit 4cb398869d
6 changed files with 64 additions and 8 deletions

View File

@@ -0,0 +1,14 @@
//! Configuration routes
use axum::{Json, extract::State};
use crate::dto::ConfigResponse;
use crate::error::ApiResult;
use crate::state::AppState;
/// Get system configuration
pub async fn get_config(State(state): State<AppState>) -> ApiResult<Json<ConfigResponse>> {
Ok(Json(ConfigResponse {
allow_registration: state.config.allow_registration,
}))
}