fix: Modrinth search categories not being serialized properly
This commit is contained in:
parent
33c865893f
commit
37b85adefa
1 changed files with 8 additions and 4 deletions
|
|
@ -97,20 +97,24 @@ impl ProviderExt for ModrinthProviderImpl {
|
||||||
let url = url.as_str();
|
let url = url.as_str();
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct SearchResults {
|
struct Response {
|
||||||
pub hits: Vec<SearchResult>,
|
pub hits: Vec<ModrinthSearchResult>,
|
||||||
pub offset: usize,
|
pub offset: usize,
|
||||||
pub limit: usize,
|
pub limit: usize,
|
||||||
pub total_hits: usize,
|
pub total_hits: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
let response = http::fetch_json::<SearchResults>(Method::GET, url, None, None).await?;
|
let response = http::fetch_json::<Response>(Method::GET, url, None, None).await?;
|
||||||
|
|
||||||
Ok(Paginated {
|
Ok(Paginated {
|
||||||
offset: response.offset,
|
offset: response.offset,
|
||||||
limit: response.limit,
|
limit: response.limit,
|
||||||
total: response.total_hits,
|
total: response.total_hits,
|
||||||
items: response.hits,
|
items: response
|
||||||
|
.hits
|
||||||
|
.into_iter()
|
||||||
|
.map(Into::into)
|
||||||
|
.collect::<Vec<_>>(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue