예제 #1
0
        public IActionResult SaveComments(int submissionId, [FromQuery] string file, [FromQuery] string commentsJson)
        {
            string userId = _userManager.GetUserId(HttpContext.User);

            try
            {
                if (_projectLogic.SaveComments(userId, submissionId, file, commentsJson))
                {
                    return(Ok());
                }
                else
                {
                    return(StatusCode(500));
                }
            }
            catch (NotFoundException)
            {
                return(NotFound());
            }
            catch (IllegalAccessException)
            {
                return(Challenge());
            }
        }