mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
chore: removed id at schema
This commit is contained in:
parent
ac414b25bc
commit
ce28be2641
@ -16,7 +16,7 @@ import { checkBotFlag, checkUserFlag, formatNumber, parseCookie } from '@utils/T
|
|||||||
import NotFound from '../../404'
|
import NotFound from '../../404'
|
||||||
import Footer from '@components/Footer'
|
import Footer from '@components/Footer'
|
||||||
import { Field, Form, Formik } from 'formik'
|
import { Field, Form, Formik } from 'formik'
|
||||||
import { ReportBotSchema } from '@utils/Yup'
|
import { ReportSchema } from '@utils/Yup'
|
||||||
|
|
||||||
const Container = dynamic(() => import('@components/Container'))
|
const Container = dynamic(() => import('@components/Container'))
|
||||||
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
||||||
@ -186,8 +186,7 @@ const Bots: NextPage<BotsProps> = ({ data, date, user, theme, setTheme }) => {
|
|||||||
신고하기
|
신고하기
|
||||||
</a>
|
</a>
|
||||||
<Modal header={`${data.name}#${data.tag} 신고하기`} isOpen={reportModal} onClose={() => setReportModal(false)} full dark={theme === 'dark'}>
|
<Modal header={`${data.name}#${data.tag} 신고하기`} isOpen={reportModal} onClose={() => setReportModal(false)} full dark={theme === 'dark'}>
|
||||||
<Formik onSubmit={console.log} validationSchema={ReportBotSchema} initialValues={{
|
<Formik onSubmit={console.log} validationSchema={ReportSchema} initialValues={{
|
||||||
id: data.id,
|
|
||||||
category: null,
|
category: null,
|
||||||
description: ''
|
description: ''
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@ -195,16 +195,14 @@ export interface BotStatUpdate {
|
|||||||
servers: number
|
servers: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ReportBotSchema: Yup.SchemaOf<ReportBot> = Yup.object({
|
export const ReportSchema: Yup.SchemaOf<Report> = Yup.object({
|
||||||
category: Yup.mixed().oneOf(reportCats, '신고 구분은 필수 항목입니다.').required('신고 구분은 필수 항목입니다.'),
|
category: Yup.mixed().oneOf(reportCats, '신고 구분은 필수 항목입니다.').required('신고 구분은 필수 항목입니다.'),
|
||||||
description: Yup.string().min(100, '최소 100자여야합니다.').max(2000, '2000자 이하로 입력해주세요.').required('설명은 필수 항목입니다.'),
|
description: Yup.string().min(100, '최소 100자여야합니다.').max(1500, '1500자 이하로 입력해주세요.').required('설명은 필수 항목입니다.')
|
||||||
id: Yup.string().required()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
interface ReportBot {
|
export interface Report {
|
||||||
category: string
|
category: string
|
||||||
description: string
|
description: string
|
||||||
id: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ManageBotSchema = Yup.object({
|
export const ManageBotSchema = Yup.object({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user