예제 #1
0
        public IActionResult AddCommentToShoePic(string text, int shoePicId)
        {
            if (UserIsAuthenticated())
            {
                var currentUserId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
                //var currentUser = _userData.GetUser(currentUserId);
                _commentData.AddComment(text, shoePicId, currentUserId);
                var shoePic = _shoePicData.GetShoePicWithComments(shoePicId);

                return(View("ShoePicWithComments", shoePic));
            }
            else
            {
                return(RedirectToPage("/Account/LogIn", "", new { area = "Identity" }));
            }
        }
예제 #2
0
 public IActionResult AddComment(Comment newComment, int ticketId)
 {
     _commentData.AddComment(ticketId, newComment);
     return(Ok($"Comment has been added to ticket with Id of {ticketId}"));
 }