mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: check given param is not null
This commit is contained in:
parent
606f3cbc82
commit
8c95cc4bb8
@ -597,9 +597,11 @@ async function resetServerToken(id: string, beforeToken: string) {
|
||||
return token
|
||||
}
|
||||
|
||||
async function Github(id: string, github: string) {
|
||||
const user = await knex('users').where({ github }).whereNot({ id })
|
||||
if(github && user.length !== 0) return 0
|
||||
async function Github(id: string, github: string | null) {
|
||||
if(github) {
|
||||
const user = await knex('users').where({ github }).whereNot({ id })
|
||||
if(user.length !== 0) return 0
|
||||
}
|
||||
await knex('users').update({ github }).where({ id })
|
||||
return 1
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user