mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
commit
fdfbab98ca
@ -5,7 +5,7 @@ import ResponseWrapper from '@utils/ResponseWrapper'
|
|||||||
import { BotList } from '@types'
|
import { BotList } from '@types'
|
||||||
|
|
||||||
const NewList = RequestHandler().get(async (_req, res) => {
|
const NewList = RequestHandler().get(async (_req, res) => {
|
||||||
const result = await get.list.votes.load(1)
|
const result = await get.list.new.load(1)
|
||||||
return ResponseWrapper<BotList>(res, { code: 200, data: result })
|
return ResponseWrapper<BotList>(res, { code: 200, data: result })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { get } from '@utils/Query'
|
|||||||
import Day from '@utils/Day'
|
import Day from '@utils/Day'
|
||||||
import { ReportSchema } from '@utils/Yup'
|
import { ReportSchema } from '@utils/Yup'
|
||||||
import Fetch from '@utils/Fetch'
|
import Fetch from '@utils/Fetch'
|
||||||
import { checkBotFlag, checkUserFlag, formatNumber, parseCookie } from '@utils/Tools'
|
import { checkBotFlag, checkUserFlag, formatNumber, parseCookie, redirectTo } from '@utils/Tools'
|
||||||
import { getToken } from '@utils/Csrf'
|
import { getToken } from '@utils/Csrf'
|
||||||
|
|
||||||
import NotFound from '../../404'
|
import NotFound from '../../404'
|
||||||
@ -35,7 +35,6 @@ const Button = dynamic(() => import('@components/Button'))
|
|||||||
const TextArea = dynamic(() => import('@components/Form/TextArea'))
|
const TextArea = dynamic(() => import('@components/Form/TextArea'))
|
||||||
const Modal = dynamic(() => import('@components/Modal'))
|
const Modal = dynamic(() => import('@components/Modal'))
|
||||||
const NSFW = dynamic(() => import('@components/NSFW'))
|
const NSFW = dynamic(() => import('@components/NSFW'))
|
||||||
const Login = dynamic(() => import('@components/Login'))
|
|
||||||
|
|
||||||
const Bots: NextPage<BotsProps> = ({ data, desc, date, user, theme, csrfToken }) => {
|
const Bots: NextPage<BotsProps> = ({ data, desc, date, user, theme, csrfToken }) => {
|
||||||
const bg = checkBotFlag(data?.flags, 'trusted') && data?.banner
|
const bg = checkBotFlag(data?.flags, 'trusted') && data?.banner
|
||||||
@ -208,7 +207,10 @@ const Bots: NextPage<BotsProps> = ({ data, desc, date, user, theme, csrfToken })
|
|||||||
))}
|
))}
|
||||||
<div className='list grid'>
|
<div className='list grid'>
|
||||||
<a className='text-red-600 hover:underline cursor-pointer' onClick={() => {
|
<a className='text-red-600 hover:underline cursor-pointer' onClick={() => {
|
||||||
if(!user) return <Login />
|
if(!user) {
|
||||||
|
localStorage.redirectTo = window.location.href
|
||||||
|
redirectTo(router, 'login')
|
||||||
|
}
|
||||||
else setReportModal(true)
|
else setReportModal(true)
|
||||||
}} aria-hidden='true'>
|
}} aria-hidden='true'>
|
||||||
<i className='far fa-flag' /> 신고하기
|
<i className='far fa-flag' /> 신고하기
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { Field, Form, Formik } from 'formik'
|
|||||||
|
|
||||||
import { Bot, User, ResponseProps, Theme } from '@types'
|
import { Bot, User, ResponseProps, Theme } from '@types'
|
||||||
import { get } from '@utils/Query'
|
import { get } from '@utils/Query'
|
||||||
import { checkUserFlag, parseCookie } from '@utils/Tools'
|
import { checkUserFlag, parseCookie, redirectTo } from '@utils/Tools'
|
||||||
import { getToken } from '@utils/Csrf'
|
import { getToken } from '@utils/Csrf'
|
||||||
import Fetch from '@utils/Fetch'
|
import Fetch from '@utils/Fetch'
|
||||||
import { ReportSchema } from '@utils/Yup'
|
import { ReportSchema } from '@utils/Yup'
|
||||||
@ -16,6 +16,7 @@ import { ReportSchema } from '@utils/Yup'
|
|||||||
import NotFound from '../404'
|
import NotFound from '../404'
|
||||||
import { KoreanbotsEndPoints, reportCats } from '@utils/Constants'
|
import { KoreanbotsEndPoints, reportCats } from '@utils/Constants'
|
||||||
import { NextSeo } from 'next-seo'
|
import { NextSeo } from 'next-seo'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
const Container = dynamic(() => import('@components/Container'))
|
const Container = dynamic(() => import('@components/Container'))
|
||||||
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
||||||
@ -29,9 +30,9 @@ const Message = dynamic(() => import('@components/Message'))
|
|||||||
const Modal = dynamic(() => import('@components/Modal'))
|
const Modal = dynamic(() => import('@components/Modal'))
|
||||||
const Button = dynamic(() => import('@components/Button'))
|
const Button = dynamic(() => import('@components/Button'))
|
||||||
const TextArea = dynamic(() => import('@components/Form/TextArea'))
|
const TextArea = dynamic(() => import('@components/Form/TextArea'))
|
||||||
const Login = dynamic(() => import('@components/Login'))
|
|
||||||
|
|
||||||
const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
|
const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
|
||||||
|
const router = useRouter()
|
||||||
const [ reportModal, setReportModal ] = useState(false)
|
const [ reportModal, setReportModal ] = useState(false)
|
||||||
const [ reportRes, setReportRes ] = useState<ResponseProps<null>>(null)
|
const [ reportRes, setReportRes ] = useState<ResponseProps<null>>(null)
|
||||||
if (!data?.id) return <NotFound />
|
if (!data?.id) return <NotFound />
|
||||||
@ -98,7 +99,10 @@ const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
|
|||||||
)}
|
)}
|
||||||
<div className='list-none mt-2'>
|
<div className='list-none mt-2'>
|
||||||
<a className='text-red-600 hover:underline cursor-pointer' onClick={() => {
|
<a className='text-red-600 hover:underline cursor-pointer' onClick={() => {
|
||||||
if(!user) return <Login />
|
if(!user) {
|
||||||
|
localStorage.redirectTo = window.location.href
|
||||||
|
redirectTo(router, 'login')
|
||||||
|
}
|
||||||
else setReportModal(true)
|
else setReportModal(true)
|
||||||
}} aria-hidden='true'>
|
}} aria-hidden='true'>
|
||||||
<i className='far fa-flag' />
|
<i className='far fa-flag' />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user