mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: support searching with index
This commit is contained in:
parent
a2c115d62b
commit
273bed7e0c
@ -10,7 +10,7 @@ const BotSubmit = RequestHandler()
|
||||
const bot = await get.BotAuthorization(req.headers.authorization)
|
||||
if(bot !== DiscordBot.user.id) return ResponseWrapper(res, { code: 403 })
|
||||
const submits = await get.botSubmitList()
|
||||
const submit = submits.find(el => el.id === req.query.id)
|
||||
const submit = submits.find((el, n) => el.id === req.query.id || n+1 === Number(req.query.id))
|
||||
if(!submit) return ResponseWrapper(res, { code: 404 })
|
||||
return ResponseWrapper(res, { code: 200, data: submit })
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user