summaryrefslogtreecommitdiffstats
path: root/server/src/api/comment.rs
diff options
context:
space:
mode:
authorFelix <me@nutomic.com>2020-04-29 16:51:25 +0200
committerFelix <me@nutomic.com>2020-04-29 16:51:25 +0200
commitc43f06124a00f3af8559d849541c2b84d3383f13 (patch)
tree0f850596a52cdfa77bff0eb620056432558af8b0 /server/src/api/comment.rs
parent0c0c68398609d549a757a9c3a26ce2311075fa38 (diff)
Address comments, implement delete for posts and comments
Diffstat (limited to 'server/src/api/comment.rs')
-rw-r--r--server/src/api/comment.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/src/api/comment.rs b/server/src/api/comment.rs
index a6742e4c..17b52d2f 100644
--- a/server/src/api/comment.rs
+++ b/server/src/api/comment.rs
@@ -339,6 +339,14 @@ impl Perform for Oper<EditComment> {
updated_comment.send_update(&user, &conn)?;
+ if let Some(deleted) = data.deleted.to_owned() {
+ if deleted {
+ updated_comment.send_delete(&user, &conn)?;
+ } else {
+ // TODO: undo delete
+ }
+ }
+
let mut recipient_ids = Vec::new();
// Scan the comment for user mentions, add those rows