mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
This commit is contained in:
parent
eaedd77cfd
commit
ddd39c8fac
@ -17,6 +17,7 @@ import { ResponseProps, SubmittedBot, Theme, User } from '@types'
|
|||||||
|
|
||||||
const CheckBox = dynamic(() => import('@components/Form/CheckBox'))
|
const CheckBox = dynamic(() => import('@components/Form/CheckBox'))
|
||||||
const Label = dynamic(() => import('@components/Form/Label'))
|
const Label = dynamic(() => import('@components/Form/Label'))
|
||||||
|
const Login = dynamic(() => import('@components/Login'))
|
||||||
const Input = dynamic(() => import('@components/Form/Input'))
|
const Input = dynamic(() => import('@components/Form/Input'))
|
||||||
const Divider = dynamic(() => import('@components/Divider'))
|
const Divider = dynamic(() => import('@components/Divider'))
|
||||||
const TextArea = dynamic(() => import('@components/Form/TextArea'))
|
const TextArea = dynamic(() => import('@components/Form/TextArea'))
|
||||||
@ -58,6 +59,7 @@ const AddBot:NextPage<AddBotProps> = ({ logged, user, csrfToken, theme }) => {
|
|||||||
_csrf: csrfToken,
|
_csrf: csrfToken,
|
||||||
_captcha: 'captcha'
|
_captcha: 'captcha'
|
||||||
}
|
}
|
||||||
|
|
||||||
function toLogin() {
|
function toLogin() {
|
||||||
localStorage.redirectTo = window.location.href
|
localStorage.redirectTo = window.location.href
|
||||||
redirectTo(router, 'login')
|
redirectTo(router, 'login')
|
||||||
@ -67,10 +69,10 @@ const AddBot:NextPage<AddBotProps> = ({ logged, user, csrfToken, theme }) => {
|
|||||||
const res = await Fetch<SubmittedBot>(`/bots/${value.id}`, { method: 'POST', body: JSON.stringify(cleanObject<AddBotSubmit>({ ...value, _captcha: token})) })
|
const res = await Fetch<SubmittedBot>(`/bots/${value.id}`, { method: 'POST', body: JSON.stringify(cleanObject<AddBotSubmit>({ ...value, _captcha: token})) })
|
||||||
setData(res)
|
setData(res)
|
||||||
}
|
}
|
||||||
if(!logged) {
|
|
||||||
toLogin()
|
if(!logged) return <Login>
|
||||||
return <NextSeo title='새로운 봇 추가하기' description='자신의 봇을 한국 디스코드봇 리스트에 등록하세요.' />
|
<NextSeo title='새로운 봇 추가하기' description='자신의 봇을 한국 디스코드봇 리스트에 등록하세요.' />
|
||||||
}
|
</Login>
|
||||||
return <Container paddingTop className='py-5'>
|
return <Container paddingTop className='py-5'>
|
||||||
<NextSeo title='새로운 봇 추가하기' description='자신의 봇을 한국 디스코드봇 리스트에 등록하세요.' />
|
<NextSeo title='새로운 봇 추가하기' description='자신의 봇을 한국 디스코드봇 리스트에 등록하세요.' />
|
||||||
<h1 className='text-3xl font-bold'>새로운 봇 추가하기</h1>
|
<h1 className='text-3xl font-bold'>새로운 봇 추가하기</h1>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user