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

Function admin_retry_article_request

crates/frontend/src/api.rs:5769–5801  ·  view source on GitHub ↗
(request_id: &str)

Source from the content-addressed store, hash-verified

5767}
5768
5769pub async fn admin_retry_article_request(request_id: &str) -> Result<ArticleRequestItem, String> {
5770 #[cfg(feature = "mock")]
5771 {
5772 let _ = request_id;
5773 Err("mock not supported".to_string())
5774 }
5775
5776 #[cfg(not(feature = "mock"))]
5777 {
5778 let base = admin_base();
5779 let url = format!(
5780 "{base}/admin/article-requests/tasks/{}/retry",
5781 urlencoding::encode(request_id)
5782 );
5783 let response = api_post(&url)
5784 .json(&serde_json::json!({}))
5785 .map_err(|e| format!("Serialize error: {:?}", e))?
5786 .send()
5787 .await
5788 .map_err(|e| format!("Network error: {:?}", e))?;
5789 if !response.ok() {
5790 let text = response
5791 .text()
5792 .await
5793 .map_err(|e| format!("Read error: {:?}", e))?;
5794 return Err(format!("Failed: {text}"));
5795 }
5796 response
5797 .json()
5798 .await
5799 .map_err(|e| format!("Parse error: {:?}", e))
5800 }
5801}
5802
5803pub async fn admin_delete_article_request(request_id: &str) -> Result<(), String> {
5804 #[cfg(feature = "mock")]

Callers 1

admin_pageFunction · 0.50

Calls 3

admin_baseFunction · 0.85
api_postFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected