fix: user and post deletion
This commit is contained in:
parent
5a9160f612
commit
7f0cb1f2a1
2 changed files with 4 additions and 2 deletions
|
@ -543,7 +543,7 @@ impl DataManager {
|
|||
// delete transfers
|
||||
let res = execute!(
|
||||
&conn,
|
||||
"DELETE FROM transfers WHERE sender = $1 OR receiver = $2",
|
||||
"DELETE FROM transfers WHERE sender = $1 OR receiver = $1",
|
||||
&[&(id as i64)]
|
||||
);
|
||||
|
||||
|
|
|
@ -2221,7 +2221,9 @@ impl DataManager {
|
|||
|
||||
// decr parent comment count
|
||||
if let Some(replying_to) = y.replying_to {
|
||||
self.decr_post_comments(replying_to).await.unwrap();
|
||||
if replying_to != 0 {
|
||||
self.decr_post_comments(replying_to).await.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
// decr user post count
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue