56482911b8
CI / Check (push) Has been skipped
CI / Detect Changes (push) Successful in 6s
CI / Deploy Agent (push) Successful in 4m8s
CI / Deploy Dashboard (push) Successful in 4m58s
CI / Deploy Docs (push) Has been skipped
CI / Deploy MCP (push) Has been skipped
26 lines
724 B
Rust
26 lines
724 B
Rust
use dioxus::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use compliance_core::models::TrackerIssue;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
|
pub struct IssuesListResponse {
|
|
pub data: Vec<TrackerIssue>,
|
|
pub total: Option<u64>,
|
|
pub page: Option<u64>,
|
|
}
|
|
|
|
#[server]
|
|
pub async fn fetch_issues(page: u64) -> Result<IssuesListResponse, ServerFnError> {
|
|
let resp = super::agent_client::agent_get(&format!("/api/v1/issues?page={page}&limit=20"))
|
|
.await?
|
|
.send()
|
|
.await
|
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
|
let body: IssuesListResponse = resp
|
|
.json()
|
|
.await
|
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
|
Ok(body)
|
|
}
|