mirror of
https://github.com/koreanbots/core.git
synced 2025-12-17 06:40:24 +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
|
return token
|
||||||
}
|
}
|
||||||
|
|
||||||
async function Github(id: string, github: string) {
|
async function Github(id: string, github: string | null) {
|
||||||
|
if(github) {
|
||||||
const user = await knex('users').where({ github }).whereNot({ id })
|
const user = await knex('users').where({ github }).whereNot({ id })
|
||||||
if(github && user.length !== 0) return 0
|
if(user.length !== 0) return 0
|
||||||
|
}
|
||||||
await knex('users').update({ github }).where({ id })
|
await knex('users').update({ github }).where({ id })
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user