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

Function fetch_admin_api_behavior_config

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

Source from the content-addressed store, hash-verified

3508}
3509
3510pub async fn fetch_admin_api_behavior_config() -> Result<ApiBehaviorConfig, String> {
3511 #[cfg(feature = "mock")]
3512 {
3513 Ok(ApiBehaviorConfig {
3514 retention_days: 90,
3515 default_days: 30,
3516 max_days: 180,
3517 flush_batch_size: 256,
3518 flush_interval_seconds: 15,
3519 flush_max_buffer_bytes: 4 * 1024 * 1024,
3520 })
3521 }
3522
3523 #[cfg(not(feature = "mock"))]
3524 {
3525 let url = format!("{}/admin/api-behavior-config", admin_base());
3526 let response = api_get(&url)
3527 .send()
3528 .await
3529 .map_err(|e| format!("Network error: {:?}", e))?;
3530 if !response.ok() {
3531 return Err(format!("HTTP error: {}", response.status()));
3532 }
3533 response
3534 .json()
3535 .await
3536 .map_err(|e| format!("Parse error: {:?}", e))
3537 }
3538}
3539
3540pub async fn update_admin_api_behavior_config(
3541 config: &ApiBehaviorConfig,

Callers 1

admin_pageFunction · 0.85

Calls 2

api_getFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected