public async Task SaveToDb(FriendRequestVM response) { if (response.HasAccepted == true) { await _friendRequestService.AcceptFriendRequest(response); await _friendService.AddNewFriend(response); } else if (response.HasAccepted == false) { await _friendRequestService.DeclineFriendRequest(response); } }
public IHttpActionResult AcceptFriendRequest([FromBody] ISofAUser senderId) { var potvrda = _friendRequestService.AcceptFriendRequest(User.Identity.GetUserId(), senderId.Id); if (potvrda) { return(Ok()); } else { return(BadRequest()); } }
public async Task AcceptFriendRequest(string toUser) { await requestService.AcceptFriendRequest(toUser, UserId); }