Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix closing reports not marking the report as closed (#690)
Browse files Browse the repository at this point in the history
Co-authored-by: Geometrically <[email protected]>
  • Loading branch information
triphora and Geometrically authored Aug 21, 2023
1 parent 13e5644 commit c85f12f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -5432,6 +5432,19 @@
},
"query": "\n SELECT name FROM report_types\n "
},
"e37ecb6dc1509d390bb6f68ba25899d19f693554d8969bbf8f8ee14a78adf0f9": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Bool",
"Int8"
]
}
},
"query": "\n UPDATE threads\n SET show_in_mod_inbox = $1\n WHERE id = $2\n "
},
"e3cc1fd070b97c4cc36bdb2f33080d4e0d7f3c3d81312d9d28a8c3c8213ad54b": {
"describe": {
"columns": [],
Expand Down
12 changes: 12 additions & 0 deletions src/routes/v2/reports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,18 @@ pub async fn report_edit(
)
.execute(&mut *transaction)
.await?;

sqlx::query!(
"
UPDATE threads
SET show_in_mod_inbox = $1
WHERE id = $2
",
!(edit_closed || report.closed),
report.thread_id.0,
)
.execute(&mut *transaction)
.await?;
}

transaction.commit().await?;
Expand Down

0 comments on commit c85f12f

Please sign in to comment.