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:
@@ -160,7 +160,7 @@ pub async fn paypal_webhook(
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
crate::database::models::user_item::User::clear_caches(
|
||||
crate::database::models::user_item::DBUser::clear_caches(
|
||||
&[(
|
||||
crate::database::models::DBUserId(result.user_id),
|
||||
None,
|
||||
@@ -270,7 +270,7 @@ pub async fn tremendous_webhook(
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
crate::database::models::user_item::User::clear_caches(
|
||||
crate::database::models::user_item::DBUser::clear_caches(
|
||||
&[(
|
||||
crate::database::models::DBUserId(result.user_id),
|
||||
None,
|
||||
@@ -319,12 +319,12 @@ pub async fn user_payouts(
|
||||
.1;
|
||||
|
||||
let payout_ids =
|
||||
crate::database::models::payout_item::Payout::get_all_for_user(
|
||||
crate::database::models::payout_item::DBPayout::get_all_for_user(
|
||||
user.id.into(),
|
||||
&**pool,
|
||||
)
|
||||
.await?;
|
||||
let payouts = crate::database::models::payout_item::Payout::get_many(
|
||||
let payouts = crate::database::models::payout_item::DBPayout::get_many(
|
||||
&payout_ids,
|
||||
&**pool,
|
||||
)
|
||||
@@ -477,7 +477,7 @@ pub async fn create_payout(
|
||||
}
|
||||
|
||||
let mut payout_item =
|
||||
crate::database::models::payout_item::Payout {
|
||||
crate::database::models::payout_item::DBPayout {
|
||||
id: payout_id,
|
||||
user_id: user.id,
|
||||
created: Utc::now(),
|
||||
@@ -550,7 +550,7 @@ pub async fn create_payout(
|
||||
if let Some(email) = user.email {
|
||||
if user.email_verified {
|
||||
let mut payout_item =
|
||||
crate::database::models::payout_item::Payout {
|
||||
crate::database::models::payout_item::DBPayout {
|
||||
id: payout_id,
|
||||
user_id: user.id,
|
||||
created: Utc::now(),
|
||||
@@ -633,7 +633,7 @@ pub async fn create_payout(
|
||||
payout_item.insert(&mut transaction).await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
crate::database::models::User::clear_caches(&[(user.id, None)], &redis)
|
||||
crate::database::models::DBUser::clear_caches(&[(user.id, None)], &redis)
|
||||
.await?;
|
||||
|
||||
Ok(HttpResponse::NoContent().finish())
|
||||
@@ -660,7 +660,7 @@ pub async fn cancel_payout(
|
||||
|
||||
let id = info.into_inner().0;
|
||||
let payout =
|
||||
crate::database::models::payout_item::Payout::get(id.into(), &**pool)
|
||||
crate::database::models::payout_item::DBPayout::get(id.into(), &**pool)
|
||||
.await?;
|
||||
|
||||
if let Some(payout) = payout {
|
||||
|
||||
Reference in New Issue
Block a user