Пример #1
0
        public async Task <ActionResult> AcceptFriendRequest(int senderId, int receiverId, string requestId)
        {
            await _repository.DeleteFriendRequest(receiverId, requestId, senderId);

            bool res1 = await _repository.StudentExists(senderId);

            bool res2 = await _repository.StudentExists(receiverId);

            if (res1 && res2)
            {
                await _repository.AddFriend(senderId, receiverId);

                return(Ok());
            }
            else
            {
                return(BadRequest("Student doesnt exist!"));
            }
        }