Ejemplo n.º 1
0
        public IActionResult UpvoteMeme(int memeId)
        {
            User loggedUser = _memeService.GetLoggedUser(this.User.FindFirst(ClaimTypes.Name).Value);

            try
            {
                _memeService.Upvote(memeId, loggedUser);
                return(Ok());
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }