Example #1
0
        public IActionResult RemoveDownvoteComment(int id)
        {
            var token = HttpContext.Request.Cookies["user-token"];

            var myprofile = _profileRepository.GetUserByToken(token);

            var reaction = _reactionRepository.FindCommentReactionDown(myprofile.Id, id);


            _reactionRepository.RemoveCommentReaction(reaction);


            var notifyToDelete = _reactionRepository.GetNotificationByReaction($"{this.Request.Scheme}://{this.Request.Host}{this.Request.PathBase}/post/index/" + id, myprofile.FullName);

            if (notifyToDelete == null)
            {
                return(Ok());
            }

            _reactionRepository.RemoveNotify(notifyToDelete);


            return(Ok(notifyToDelete));
        }