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