public IActionResult AcceptFriendRequest(int receiverId, int senderId) { //if (senderId != _user.Id) return Ok(new { status = false }); if (_friendsRepository.IsFriends(receiverId, senderId) == false) { _friendsRepository.AcceptFriendRequest(senderId, receiverId); return(Ok(new { status = true })); } else { return(Ok(new { status = false })); } }
/// <summary> /// Accept the friend request /// </summary> /// <param name="userId"></param> /// <param name="friendId"></param> /// <returns></returns> public bool AcceptFriendRequest(int userId, int friendId) => _repository.AcceptFriendRequest(userId, friendId);
public bool AcceptFriendRequest(int userId, int friendId) { return(_context.AcceptFriendRequest(userId, friendId)); }