You've already forked AstralRinth
forked from didirus/AstralRinth
Commonize and distinguish a lot of struct names in labrinth::database::models (#3691)
This commit is contained in:
@@ -199,7 +199,7 @@ pub async fn delete_unused_images(
|
||||
redis: &RedisPool,
|
||||
) -> Result<(), ApiError> {
|
||||
let uploaded_images =
|
||||
database::models::Image::get_many_contexted(context, transaction)
|
||||
database::models::DBImage::get_many_contexted(context, transaction)
|
||||
.await?;
|
||||
|
||||
for image in uploaded_images {
|
||||
@@ -212,8 +212,8 @@ pub async fn delete_unused_images(
|
||||
}
|
||||
|
||||
if should_delete {
|
||||
image_item::Image::remove(image.id, transaction, redis).await?;
|
||||
image_item::Image::clear_cache(image.id, redis).await?;
|
||||
image_item::DBImage::remove(image.id, transaction, redis).await?;
|
||||
image_item::DBImage::clear_cache(image.id, redis).await?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ async fn get_webhook_metadata(
|
||||
redis: &RedisPool,
|
||||
emoji: bool,
|
||||
) -> Result<Option<WebhookMetadata>, ApiError> {
|
||||
let project = crate::database::models::project_item::Project::get_id(
|
||||
let project = crate::database::models::project_item::DBProject::get_id(
|
||||
project_id.into(),
|
||||
pool,
|
||||
redis,
|
||||
@@ -58,7 +58,7 @@ async fn get_webhook_metadata(
|
||||
let mut owner = None;
|
||||
|
||||
if let Some(organization_id) = project.inner.organization_id {
|
||||
let organization = crate::database::models::organization_item::Organization::get_id(
|
||||
let organization = crate::database::models::organization_item::DBOrganization::get_id(
|
||||
organization_id,
|
||||
pool,
|
||||
redis,
|
||||
@@ -77,7 +77,7 @@ async fn get_webhook_metadata(
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let team = crate::database::models::team_item::TeamMember::get_from_team_full(
|
||||
let team = crate::database::models::team_item::DBTeamMember::get_from_team_full(
|
||||
project.inner.team_id,
|
||||
pool,
|
||||
redis,
|
||||
@@ -85,7 +85,7 @@ async fn get_webhook_metadata(
|
||||
.await?;
|
||||
|
||||
if let Some(member) = team.into_iter().find(|x| x.is_owner) {
|
||||
let user = crate::database::models::user_item::User::get_id(
|
||||
let user = crate::database::models::user_item::DBUser::get_id(
|
||||
member.user_id,
|
||||
pool,
|
||||
redis,
|
||||
|
||||
Reference in New Issue
Block a user