Skip to content

Commit

Permalink
feat(search): return more user important info
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrielFR committed Jan 8, 2025
1 parent 6fbc35a commit 098af2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions queries/search_user.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ query($search: String, $page: Int = 1, $per_page: Int = 10) {
users(search: $search, sort: SEARCH_MATCH) {
id
name
about
avatar {
large
medium
}
bannerImage
}
}
}
2 changes: 2 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ impl Client {
vec.push(User {
id: user["id"].as_i64().unwrap() as i32,
name: user["name"].as_str().unwrap().to_string(),
about: user["about"].as_str().map(String::from),
avatar: Image::deserialize(&user["avatar"]).ok(),
banner: user["bannerImage"].as_str().map(String::from),

client: self.clone(),
..Default::default()
Expand Down

0 comments on commit 098af2a

Please sign in to comment.