feat: add system configuration API endpoint and frontend hook for dynamic settings
This commit is contained in:
14
notes-api/src/routes/config.rs
Normal file
14
notes-api/src/routes/config.rs
Normal 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,
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user