use crate::{ api::types::{paginated_response::PaginatedResponse, transaction::TransactionCompany}, env::Config, }; pub async fn get_transactions( company_slug: Option, page: i64, size: i64, ) -> Result, ()> { let res = reqwasm::http::Request::get(&format!( "{}transaction{}?page={}&size={}", Config::new().api_url, company_slug.unwrap_or("".to_string()), page, size, )) .send() .await .map_err(|_| ())? .json::>() .await .map_err(|_| ())?; Ok(res) }