From 4af2e717618e8d76c3de91022b6fb6adc1bd02be Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 24 Jan 2021 18:21:03 +0100 Subject: [PATCH] Delete notifications when deleting a friend --- src/controllers/friends_controller.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/friends_controller.rs b/src/controllers/friends_controller.rs index 37bafe7..9a83bf9 100644 --- a/src/controllers/friends_controller.rs +++ b/src/controllers/friends_controller.rs @@ -138,7 +138,8 @@ pub fn remove_friend(r: &mut HttpRequestHandler) -> RequestResult { friends_helper::remove_friendship(r.user_id_ref()?, &friend_id)?; - // TODO : Delete any related notification + // Delete any related notification + notifications_helper::delete_all_related_with_friendship_request(r.user_id_ref()?, &friend_id)?; r.success("The friend was removed from the list!") }