Merge pull request #142 from modrinth/follows

Hotfix everything broken
This commit is contained in:
Geometrically 2021-01-23 11:49:12 -07:00 committed by GitHub
commit 1445d6ea8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -516,8 +516,15 @@ impl Mod {
where
E: sqlx::Executor<'a, Database = sqlx::Postgres> + Copy,
{
// TODO: this could be optimized
futures::future::try_join_all(mod_ids.into_iter().map(|id| Self::get_full(id, exec))).await
let mut mods = Vec::new();
for mod_id in mod_ids {
mods.push(Self::get_full(mod_id, exec).await?)
}
Ok(mods)
/*// TODO: this could be optimized
futures::future::try_join_all(mod_ids.into_iter().map(|id| Self::get_full(id, exec))).await*/
}
}

View File

@ -568,9 +568,15 @@ impl Version {
where
E: sqlx::Executor<'a, Database = sqlx::Postgres> + Copy,
{
// TODO: this could be optimized
futures::future::try_join_all(version_ids.into_iter().map(|id| Self::get_full(id, exec)))
.await
let mut versions = Vec::new();
for version_id in version_ids {
versions.push(Self::get_full(version_id, exec).await?)
}
Ok(versions)
/* futures::future::try_join_all(version_ids.into_iter().map(|id| Self::get_full(id, exec)))
.await*/
}
}