Example #1
0
        public async Task <IActionResult> ConfirmQna(ConfirmThenAction confirmThenAction)
        {
            if (confirmThenAction != null)
            {
                if (string.IsNullOrWhiteSpace(confirmThenAction.Password))
                {
                    return(BadRequest("비밀번호를 입력해주세요"));
                }

                TempData["password"] = confirmThenAction.Password ?? "";

                string password = TempData["password"] == null ? "" : TempData["password"].ToString();
                var    qna      = await _qnaService.GetQnaById(confirmThenAction.Id);

                if (qna != null)
                {
                    if (!qna.m_passwd.Equals(password))
                    {
                        return(StatusCode(401, "비밀번호가 일치하지 않습니다."));
                    }
                    else
                    {
                        return(Ok());
                    }
                }
            }
            return(BadRequest("잘못된 요청입니다. 다시 시도해주세요."));
        }
Example #2
0
        public async Task <IActionResult> Confirm(ConfirmThenAction confirmThenAction)
        {
            if (confirmThenAction != null)
            {
                var notice = await _noticeService.GetNoticeById(confirmThenAction.Id);

                if (notice != null)
                {
                    return(Ok());//비밀번호가 없을경우 삭제
                }
            }
            return(BadRequest("잘못된 요청입니다. 다시 시도해주세요."));
        }
Example #3
0
        public async Task <IActionResult> Confirm(ConfirmThenAction confirmThenAction)
        {
            if (confirmThenAction != null)
            {
                if (string.IsNullOrWhiteSpace(confirmThenAction.Password))
                {
                    return(BadRequest("비밀번호를 입력하여 주세요."));
                }

                TempData["password"] = confirmThenAction.Password ?? "";

                string password = TempData["password"] == null ? "" : TempData["password"].ToString();
                var    notice   = await _techNoteService.GetTechNoteById(confirmThenAction.Id);

                if (notice != null)
                {
                    return(Ok());//비밀번호가 없을경우 삭제
                }
            }
            return(BadRequest("잘못된 요청입니다. 다시 시도해주세요."));
        }