private void HandleAcceptRequestButton(ClientFriendship friendstipToAccept) { var friendship = new ClientFriendshipUpdate() { User1 = friendstipToAccept.User1, User2 = friendstipToAccept.User2, Status = RelationshipStatusConstants.ACCEPTED }; Dispatcher.Dispatch(new UpdateFriendshipAction(friendship)); }
public async Task <IActionResult> UpdateFriendship([FromBody] ClientFriendshipUpdate clientFriendship) { var query = await _uow.FriendshipRepository .GetData(x => x.User1Id == clientFriendship.User1.Id && x.User2Id == clientFriendship.User2.Id); var foundFriendship = query.Single(); var mappedFriendship = _mapper.Map(clientFriendship, foundFriendship); mappedFriendship.User1 = null; mappedFriendship.User2 = null; await _uow.FriendshipRepository.Update(mappedFriendship); _logger.LogInformation("Friendship accepted"); return(Ok(_mapper.Map <ClientFriendship>(clientFriendship))); }
public UpdateFriendshipAction(ClientFriendshipUpdate updatedFriendship) { UpdatedFriendship = updatedFriendship; }