Exemple #1
0
        public IHttpActionResult UpdateFriendRequest(Guid FriendUserId, bool Accepted)
        {
            FriendRequestRepository friendReqRep = new FriendRequestRepository();
            FriendsRepository       friendRep    = new FriendsRepository();
            UserRepository          userRep      = new UserRepository();
            User user = userRep.GetUserByEmail(User.Identity.Name);

            if (Accepted)
            {
                friendRep.AddUserFriend(user.Id, FriendUserId);
                friendRep.AddUserFriend(FriendUserId, user.Id);
            }

            friendReqRep.RemoveFriendRequest(FriendUserId, user.Id);

            return(Ok());
        }