mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
feat: added botList argument schema
This commit is contained in:
parent
9a5046db0b
commit
f12805187a
11
utils/Yup.ts
11
utils/Yup.ts
@ -1,9 +1,16 @@
|
|||||||
import * as Yup from 'yup'
|
import * as Yup from 'yup'
|
||||||
|
import YupKorean from 'yup-locales-ko'
|
||||||
|
import { ListType } from '../types'
|
||||||
|
|
||||||
export const botListArgument = Yup.object({
|
Yup.setLocale(YupKorean)
|
||||||
type: Yup.string().oneOf(['VOTE', 'TRUSTED', 'NEW', 'PARTNERED', 'CATEGOORY', 'SEARCH']).required(),
|
|
||||||
|
export const botListArgumentSchema = Yup.object({
|
||||||
|
type: Yup.string().oneOf(['VOTE', 'TRUSTED', 'NEW', 'PARTNERED', 'CATEGORY', 'SEARCH']).required(),
|
||||||
page: Yup.number().positive().integer().optional().default(1),
|
page: Yup.number().positive().integer().optional().default(1),
|
||||||
query: Yup.string().optional()
|
query: Yup.string().optional()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export interface botListArgument extends Yup.Asserts<typeof botListArgumentSchema> {
|
||||||
|
type: ListType
|
||||||
|
}
|
||||||
export default Yup
|
export default Yup
|
||||||
Loading…
x
Reference in New Issue
Block a user