Fix report + mod deletion (#626)

This commit is contained in:
Geometrically 2023-06-01 08:53:16 -07:00 committed by GitHub
parent fe25cd3bec
commit abc99c7e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -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(()))
}

View File

@ -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(()))
}
}