MCPcopy Create free account
hub / github.com/acking-you/static_flow / fetch_admin_comment_runtime_config

Function fetch_admin_comment_runtime_config

crates/frontend/src/api.rs:4014–4039  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4012}
4013
4014pub async fn fetch_admin_comment_runtime_config() -> Result<CommentRuntimeConfig, String> {
4015 #[cfg(feature = "mock")]
4016 {
4017 Ok(CommentRuntimeConfig {
4018 submit_rate_limit_seconds: 60,
4019 list_default_limit: 20,
4020 cleanup_retention_days: -1,
4021 })
4022 }
4023
4024 #[cfg(not(feature = "mock"))]
4025 {
4026 let url = format!("{}/admin/comment-config", admin_base());
4027 let response = api_get(&url)
4028 .send()
4029 .await
4030 .map_err(|e| format!("Network error: {:?}", e))?;
4031 if !response.ok() {
4032 return Err(format!("HTTP error: {}", response.status()));
4033 }
4034 response
4035 .json()
4036 .await
4037 .map_err(|e| format!("Parse error: {:?}", e))
4038 }
4039}
4040
4041pub async fn update_admin_comment_runtime_config(
4042 config: &CommentRuntimeConfig,

Callers 1

admin_pageFunction · 0.85

Calls 2

api_getFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected