From c31c9488dbf75324ac82e6217f12d6ce9c7187a3 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 18 Feb 2018 18:33:26 +0100 Subject: [PATCH] Notifications deleted on posts deletion. --- RestControllers/postsController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RestControllers/postsController.php b/RestControllers/postsController.php index 6ed2ff0..0e0dbd6 100644 --- a/RestControllers/postsController.php +++ b/RestControllers/postsController.php @@ -431,10 +431,11 @@ class postsController { if(!CS::get()->components->posts->delete($postID)) Rest_fatal_error(500, "Couldn't delete post!"); - /*//Delete related notifications + //Delete related notifications $notification = new Notification(); $notification->set_on_elem_type(Notification::POST); - $notification->set_on_elem_id($postID);*/ + $notification->set_on_elem_id($postID); + components()->notifications->delete($notification); //Success return array("success" => "The post has been deleted!");