style: fixed deepscan warning

This commit is contained in:
원더 2021-02-09 19:41:54 +09:00
parent 6254fcc92d
commit 073aeb8650

View File

@ -147,9 +147,7 @@ async function getBotList(type: ListType, page = 1, query?: string):Promise<BotL
.select(['id']) .select(['id'])
} else if (type === 'SEARCH') { } else if (type === 'SEARCH') {
if (!query) throw new Error('쿼리가 누락되었습니다.') if (!query) throw new Error('쿼리가 누락되었습니다.')
count = ( count = (await knex.raw('SELECT count(*) FROM bots WHERE MATCH(`name`, `intro`, `desc`) AGAINST(? in boolean mode)', [decodeURI(query)]))[0][0]['count(*)']
(await knex.raw('SELECT count(*) FROM bots WHERE MATCH(`name`, `intro`, `desc`) AGAINST(? in boolean mode)', [decodeURI(query)]))
)[0][0]['count(*)']
res = (await knex.raw('SELECT id, votes, MATCH(`name`, `intro`, `desc`) AGAINST(? in boolean mode) as relevance FROM bots WHERE MATCH(`name`, `intro`, `desc`) AGAINST(? in boolean mode) ORDER BY relevance DESC, votes DESC LIMIT 16 OFFSET ?', [decodeURI(query), decodeURI(query), ((page ? Number(page) : 1) - 1) * 16]))[0] res = (await knex.raw('SELECT id, votes, MATCH(`name`, `intro`, `desc`) AGAINST(? in boolean mode) as relevance FROM bots WHERE MATCH(`name`, `intro`, `desc`) AGAINST(? in boolean mode) ORDER BY relevance DESC, votes DESC LIMIT 16 OFFSET ?', [decodeURI(query), decodeURI(query), ((page ? Number(page) : 1) - 1) * 16]))[0]
console.log(res) console.log(res)
} else { } else {