public async Task <IActionResult> AddFriendRequest([FromQuery] string username) { int userId = ClaimHelper.FindNameIdentifier(HttpContext.User.Claims); var response = await _friendService.AddFriendRequest(userId, username); if (!response.Success) { return(BadRequest(response.Message)); } var friendDto = _mapper.Map <Friend, FriendDto>(response.Resource); return(Ok(friendDto)); }
public void AddFriendRequest(int id) { friendService.AddFriendRequest(currentUser.Id, id); }