You've already forked AstralRinth
forked from didirus/AstralRinth
Public Webhook Fixes (#493)
* Public discord webhook * Switch to jsonb for most queries + make gallery featured first * Run fmt + clippy + prepare
This commit is contained in:
@@ -277,7 +277,7 @@ pub async fn project_create(
|
||||
&***file_host,
|
||||
&flame_anvil_queue,
|
||||
&mut uploaded_files,
|
||||
&*client,
|
||||
&client,
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -723,7 +723,6 @@ pub async fn project_create_inner(
|
||||
})?;
|
||||
|
||||
donation_urls.push(models::project_item::DonationUrl {
|
||||
project_id: project_id.into(),
|
||||
platform_id,
|
||||
platform_short: "".to_string(),
|
||||
platform_name: "".to_string(),
|
||||
@@ -759,7 +758,6 @@ pub async fn project_create_inner(
|
||||
gallery_items: gallery_urls
|
||||
.iter()
|
||||
.map(|x| models::project_item::GalleryItem {
|
||||
project_id: project_id.into(),
|
||||
image_url: x.url.clone(),
|
||||
featured: x.featured,
|
||||
title: x.title.clone(),
|
||||
|
||||
@@ -500,7 +500,7 @@ pub async fn project_edit(
|
||||
{
|
||||
crate::util::webhook::send_discord_webhook(
|
||||
project_item.inner.id.into(),
|
||||
&*pool,
|
||||
&pool,
|
||||
webhook_url,
|
||||
)
|
||||
.await
|
||||
@@ -529,7 +529,7 @@ pub async fn project_edit(
|
||||
{
|
||||
crate::util::webhook::send_discord_webhook(
|
||||
project_item.inner.id.into(),
|
||||
&*pool,
|
||||
&pool,
|
||||
webhook_url,
|
||||
)
|
||||
.await
|
||||
@@ -1483,14 +1483,13 @@ pub async fn add_gallery_item(
|
||||
}
|
||||
|
||||
database::models::project_item::GalleryItem {
|
||||
project_id: project_item.id,
|
||||
image_url: format!("{}/{}", cdn_url, url),
|
||||
featured: item.featured,
|
||||
title: item.title,
|
||||
description: item.description,
|
||||
created: Utc::now(),
|
||||
}
|
||||
.insert(&mut transaction)
|
||||
.insert(project_item.id, &mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -133,7 +133,7 @@ pub async fn mod_create(
|
||||
&***file_host,
|
||||
&flame_anvil_queue,
|
||||
&mut uploaded_files,
|
||||
&*client,
|
||||
&client,
|
||||
)
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user