mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-26 07:19:22 +00:00
Send a notification when responding to friensdhip request
This commit is contained in:
parent
919f4184b7
commit
c7c651e6fe
@ -119,7 +119,15 @@ pub fn respond_request(r: &mut HttpRequestHandler) -> RequestResult {
|
|||||||
|
|
||||||
friends_helper::respond_request(r.user_id_ref()?, &friend_id, accept)?;
|
friends_helper::respond_request(r.user_id_ref()?, &friend_id, accept)?;
|
||||||
|
|
||||||
// TODO : create a notification
|
// Create a notification
|
||||||
|
notifications_helper::create_friends_notification(
|
||||||
|
r.user_id_ref()?,
|
||||||
|
&friend_id,
|
||||||
|
match accept {
|
||||||
|
true => NotifEventType::ACCEPTED_FRIEND_REQUEST,
|
||||||
|
false => NotifEventType::REJECTED_FRIEND_REQUEST
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
r.set_response("Response to the friendship request successfully saved!")
|
r.set_response("Response to the friendship request successfully saved!")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user