-function checkAccountIdExists (id: number | string, res: express.Response, callback: (err: Error, account: AccountInstance) => any) {
- let promise: Bluebird<AccountInstance>
-
- if (validator.isInt('' + id)) {
- promise = db.Account.load(+id)
- } else { // UUID
- promise = db.Account.loadByUUID('' + id)
- }
-
- return checkAccountExists(promise, res, callback)
-}
-
-function checkLocalAccountNameExists (name: string, res: express.Response, callback: (err: Error, account: AccountInstance) => any) {
- const p = db.Account.loadLocalByName(name)
-
- return checkAccountExists(p, res, callback)