chore: changed variable

This commit is contained in:
원더 2021-01-29 22:01:10 +09:00
parent 54dde9dca6
commit 0d26a218af

View File

@ -6,7 +6,7 @@ import { User as DiscordUser } from 'discord.js'
import { Stream } from 'stream' import { Stream } from 'stream'
import { Bot, User, ListType, BotList, TokenRegister } from '@types' import { Bot, User, ListType, BotList, TokenRegister } from '@types'
import { cats } from './Constants' import { categories } from './Constants'
import knex from './Knex' import knex from './Knex'
import DiscordBot from './DiscordBot' import DiscordBot from './DiscordBot'
@ -127,7 +127,7 @@ async function getBotList(type: ListType, page = 1, query?: string):Promise<BotL
.select(['id']) .select(['id'])
} else if (type === 'CATEGORY') { } else if (type === 'CATEGORY') {
if (!query) throw new Error('쿼리가 누락되었습니다.') if (!query) throw new Error('쿼리가 누락되었습니다.')
if (!cats.includes(query)) throw new Error('알 수 없는 카테고리입니다.') if (!categories.includes(query)) throw new Error('알 수 없는 카테고리입니다.')
count = ( count = (
await knex('bots') await knex('bots')
.where('category', 'like', `%${decodeURI(query)}%`) .where('category', 'like', `%${decodeURI(query)}%`)