Пример #1
0
        public IActionResult Post(ReviewPostCharacter reviewPostCharacter)
        {
            var currentUserProfile = GetCurrentUserProfile();
            var currentPost        = _reviewPostRepository.GetById(reviewPostCharacter.ReviewPostId);

            if (currentUserProfile.Id != currentPost.UserProfileId)
            {
                return(Unauthorized());
            }

            _characterRepository.AddCharacterToPost(reviewPostCharacter);
            return(CreatedAtAction("Get", new { id = reviewPostCharacter.Id }, reviewPostCharacter));
        }