chore: delete bot real working

IMPORTANT: NOW DELETE BOT REAL WORKS!
This commit is contained in:
wonderlandpark 2021-05-05 19:51:14 +09:00
parent c317cc24b3
commit 27750207a2
No known key found for this signature in database
GPG Key ID: E3E650B146478C64

View File

@ -1,7 +1,7 @@
import { NextApiRequest } from 'next' import { NextApiRequest } from 'next'
import rateLimit from 'express-rate-limit' import rateLimit from 'express-rate-limit'
import { CaptchaVerify, get, put, update } from '@utils/Query' import { CaptchaVerify, get, put, remove, update } from '@utils/Query'
import ResponseWrapper from '@utils/ResponseWrapper' import ResponseWrapper from '@utils/ResponseWrapper'
import { checkToken } from '@utils/Csrf' import { checkToken } from '@utils/Csrf'
import { AddBotSubmit, AddBotSubmitSchema, CsrfCaptcha, ManageBot, ManageBotSchema } from '@utils/Yup' import { AddBotSubmit, AddBotSubmitSchema, CsrfCaptcha, ManageBot, ManageBotSchema } from '@utils/Yup'
@ -86,8 +86,7 @@ const Bots = RequestHandler()
const captcha = await CaptchaVerify(req.body._captcha) const captcha = await CaptchaVerify(req.body._captcha)
if(!captcha) return ResponseWrapper(res, { code: 400, message: '캡챠 검증에 실패하였습니다.' }) if(!captcha) return ResponseWrapper(res, { code: 400, message: '캡챠 검증에 실패하였습니다.' })
if(req.body.name !== bot.name) return ResponseWrapper(res, { code: 400, message: '봇 이름을 입력해주세요.' }) if(req.body.name !== bot.name) return ResponseWrapper(res, { code: 400, message: '봇 이름을 입력해주세요.' })
// 봇 삭제 구분 테스트를 위해 비활성화 remove.bot(bot.id)
// remove.bot(bot.id)
return ResponseWrapper(res, { code: 200, message: '성공적으로 삭제했습니다.' }) return ResponseWrapper(res, { code: 200, message: '성공적으로 삭제했습니다.' })