Пример #1
0
        public IActionResult AddFriend(int serialNumber, List <int> friendId)
        {
            var clinker = _repo.Get(serialNumber);

            _repo.AddFriend(serialNumber, friendId[0]);

            return(Ok(clinker.Friends));
        }
        public IActionResult UpdateClinkerFriend(Guid clinkerId, Guid friendId)
        {
            var repo = new ClinkerRepository();

            var clinkerThatGotUpdated = repo.AddFriend(clinkerId, friendId);

            return(Ok(clinkerThatGotUpdated));
        }
        public IActionResult AddFriend(int id, int friendId)
        {
            var usersExist = _repo.AddFriend(id, friendId);

            if (usersExist)
            {
                return(Created($"api/clinkers/{id}/add-friend/{friendId}", "Friend successfully added"));
            }
            return(NotFound("Cannot add friend as requested."));
        }
Пример #4
0
        public IActionResult AddClinkerToFriendsList(Clinker friendToAddd, int currentUserId)
        {
            var friendsListPlusNewFriend = _repository.AddFriend(friendToAddd, currentUserId);

            return(Ok(friendsListPlusNewFriend));
        }