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

Function patch_admin_comment_task

crates/frontend/src/api.rs:4196–4225  ·  view source on GitHub ↗
(
    task_id: &str,
    request: &AdminPatchCommentTaskRequest,
)

Source from the content-addressed store, hash-verified

4194}
4195
4196pub async fn patch_admin_comment_task(
4197 task_id: &str,
4198 request: &AdminPatchCommentTaskRequest,
4199) -> Result<AdminCommentTask, String> {
4200 #[cfg(feature = "mock")]
4201 {
4202 let _ = (task_id, request);
4203 Err("not implemented in mock".to_string())
4204 }
4205
4206 #[cfg(not(feature = "mock"))]
4207 {
4208 let url =
4209 format!("{}/admin/comments/tasks/{}", admin_base(), urlencoding::encode(task_id),);
4210 let response = api_patch(&url)
4211 .header("Content-Type", "application/json")
4212 .json(request)
4213 .map_err(|e| format!("Serialize error: {:?}", e))?
4214 .send()
4215 .await
4216 .map_err(|e| format!("Network error: {:?}", e))?;
4217 if !response.ok() {
4218 return Err(format!("HTTP error: {}", response.status()));
4219 }
4220 response
4221 .json()
4222 .await
4223 .map_err(|e| format!("Parse error: {:?}", e))
4224 }
4225}
4226
4227pub async fn admin_approve_comment_task(
4228 task_id: &str,

Callers 1

admin_pageFunction · 0.85

Calls 2

api_patchFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected