You've already forked AstralRinth
forked from didirus/AstralRinth
Fix report + mod deletion (#626)
This commit is contained in:
@@ -394,12 +394,6 @@ impl Project {
|
|||||||
.fetch_optional(&mut *transaction)
|
.fetch_optional(&mut *transaction)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some(thread_id) = thread_id {
|
|
||||||
if let Some(id) = thread_id.thread_id {
|
|
||||||
crate::database::models::Thread::remove_full(ThreadId(id), transaction).await?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
"
|
"
|
||||||
DELETE FROM mod_follows
|
DELETE FROM mod_follows
|
||||||
@@ -527,6 +521,12 @@ impl Project {
|
|||||||
.execute(&mut *transaction)
|
.execute(&mut *transaction)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
if let Some(thread_id) = thread_id {
|
||||||
|
if let Some(id) = thread_id.thread_id {
|
||||||
|
crate::database::models::Thread::remove_full(ThreadId(id), transaction).await?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Some(()))
|
Ok(Some(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,12 +135,6 @@ impl Report {
|
|||||||
.fetch_optional(&mut *transaction)
|
.fetch_optional(&mut *transaction)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some(thread_id) = thread_id {
|
|
||||||
if let Some(id) = thread_id.thread_id {
|
|
||||||
crate::database::models::Thread::remove_full(ThreadId(id), transaction).await?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
"
|
"
|
||||||
DELETE FROM reports WHERE id = $1
|
DELETE FROM reports WHERE id = $1
|
||||||
@@ -150,6 +144,12 @@ impl Report {
|
|||||||
.execute(&mut *transaction)
|
.execute(&mut *transaction)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
if let Some(thread_id) = thread_id {
|
||||||
|
if let Some(id) = thread_id.thread_id {
|
||||||
|
crate::database::models::Thread::remove_full(ThreadId(id), transaction).await?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Some(()))
|
Ok(Some(()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user