Fix project visibility in hash routes (#792)

* Fix project visibility in hash routes

* improve

* clippy

* CLIPPYYYYYYYYYYYYYY

* clippy, I hope you know that I hate you

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Emma Alexia
2023-12-12 22:45:32 -05:00
committed by GitHub
parent f5b8c15388
commit abbeed394e
4 changed files with 26 additions and 48 deletions

View File

@@ -75,6 +75,7 @@ pub async fn forge_updates(
.collect(),
&user_option,
&pool,
redis,
)
.await?;

View File

@@ -234,6 +234,7 @@ pub async fn get_versions_from_hashes(
database::models::Version::get_many(&version_ids, &**pool, &redis).await?,
&user_option,
&pool,
redis,
)
.await?;

View File

@@ -134,7 +134,7 @@ pub async fn versions_get(
.map(|x| x.1)
.ok();
let versions = filter_authorized_versions(versions_data, &user_option, &pool).await?;
let versions = filter_authorized_versions(versions_data, &user_option, &pool, redis).await?;
Ok(HttpResponse::Ok().json(versions))
}
@@ -820,7 +820,7 @@ pub async fn version_list(
response.sort();
response.dedup_by(|a, b| a.inner.id == b.inner.id);
let response = filter_authorized_versions(response, &user_option, &pool).await?;
let response = filter_authorized_versions(response, &user_option, &pool, redis).await?;
Ok(HttpResponse::Ok().json(response))
} else {