Beispiel #1
0
        public async Task <IActionResult> AddNewComment([FromForm] CommentCreateRequest request)
        {
            var result = await _knowledgeBaseApiClient.PostComment(request);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
Beispiel #2
0
        public async Task <IActionResult> AddNewComment([FromForm] CommentCreateRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            if (!Captcha.ValidateCaptchaCode(request.CaptchaCode, HttpContext))
            {
                ModelState.AddModelError("", "Mã xác nhận không đúng");
                return(BadRequest(ModelState));
            }

            var result = await _knowledgeBaseApiClient.PostComment(request);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }