This commit is contained in:
Jonas Rabenstein 2026-02-27 03:34:25 +01:00
commit d972547059
2 changed files with 13 additions and 4 deletions

View file

@ -57,7 +57,17 @@ pub struct Spond {
// //
// //
crate::get!(search(), () => "sponds" -> Vec<Spond>); crate::get!(search(
comments: bool,
hidden: bool,
add_profile_info: bool,
scheduled: bool,
#[builder(into)] order: Order,
#[builder(default=20)]max: usize,
),
min_end_timestamp: Option<DateTime<Utc>>,
max_end_timestamp: Option<DateTime<Utc>>,
() => "sponds" -> Vec<Spond>);
//impl Search { //impl Search {
// with_comments( // with_comments(

View file

@ -1,4 +1,3 @@
/// GET macro
#[macro_export] #[macro_export]
macro_rules! get { macro_rules! get {
// Case 1: no query // Case 1: no query
@ -84,8 +83,8 @@ macro_rules! get {
} }
async move { async move {
let result = client.get_with::<_, RP>(&query.as_pairs(), ( $( $arg ),* )).await?; let result = client.get_with::<_, RP>(( $( $arg ),* ), &query.as_pairs()).await?;
Ok(result.0) Ok(result.into_inner().0)
} }
} }
}; };