Fix report + mod deletion (#626)
This commit is contained in:
parent
fe25cd3bec
commit
abc99c7e69
@ -394,12 +394,6 @@ impl Project {
|
||||
.fetch_optional(&mut *transaction)
|
||||
.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!(
|
||||
"
|
||||
DELETE FROM mod_follows
|
||||
@ -527,6 +521,12 @@ impl Project {
|
||||
.execute(&mut *transaction)
|
||||
.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(()))
|
||||
}
|
||||
|
||||
|
||||
@ -135,12 +135,6 @@ impl Report {
|
||||
.fetch_optional(&mut *transaction)
|
||||
.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!(
|
||||
"
|
||||
DELETE FROM reports WHERE id = $1
|
||||
@ -150,6 +144,12 @@ impl Report {
|
||||
.execute(&mut *transaction)
|
||||
.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(()))
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user