use colored::*; use reqwest::Error; use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Serialize, Deserialize)] struct Template { name: String, #[serde(rename = "type")] type_: String, } pub async fn list_fn() -> Result<(), Error> { let url = "http://81.71.98.176:3000/template/list"; let response = reqwest::get(url).await?; if response.status().is_success() { let body = response.text().await?; if let Ok(json) = serde_json::from_str::(&body) { if let Some(data) = json.get("data") { if let Some(template_array) = data.as_array() { for template in template_array { if let Ok(template_data) = serde_json::from_value::