예제 #1
0
        public async Task <JsonResult> PutInsertQuiz([FromBody] Quiz quiz)
        {
            var result = await quizManager.InsertQuiz(Token.UserId, quiz);

            switch (result.Status)
            {
            case SaveQuizResultStatus.NotAuthorized:
                return(ControllerHelper.CreateErrorResponse(HttpStatusCode.Unauthorized, "Unauthorized"));

            case SaveQuizResultStatus.GeneralError:
                return(ControllerHelper.CreateErrorResponse(HttpStatusCode.NotAcceptable, "GeneralError"));

            default:
                return(ControllerHelper.CreateResponse(result.Result));
            }
        }