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

Function update_admin_comment_runtime_config

crates/frontend/src/api.rs:4041–4067  ·  view source on GitHub ↗
(
    config: &CommentRuntimeConfig,
)

Source from the content-addressed store, hash-verified

4039}
4040
4041pub async fn update_admin_comment_runtime_config(
4042 config: &CommentRuntimeConfig,
4043) -> Result<CommentRuntimeConfig, String> {
4044 #[cfg(feature = "mock")]
4045 {
4046 Ok(config.clone())
4047 }
4048
4049 #[cfg(not(feature = "mock"))]
4050 {
4051 let url = format!("{}/admin/comment-config", admin_base());
4052 let response = api_post(&url)
4053 .header("Content-Type", "application/json")
4054 .json(config)
4055 .map_err(|e| format!("Serialize error: {:?}", e))?
4056 .send()
4057 .await
4058 .map_err(|e| format!("Network error: {:?}", e))?;
4059 if !response.ok() {
4060 return Err(format!("HTTP error: {}", response.status()));
4061 }
4062 response
4063 .json()
4064 .await
4065 .map_err(|e| format!("Parse error: {:?}", e))
4066 }
4067}
4068
4069pub async fn fetch_admin_comment_tasks_grouped(
4070 status: Option<&str>,

Callers 1

admin_pageFunction · 0.85

Calls 3

api_postFunction · 0.85
cloneMethod · 0.80
okMethod · 0.80

Tested by

no test coverage detected