mirror of
https://github.com/wassname/talk.git
synced 2026-10-28 13:30:17 +08:00
Adjusted promise
This commit is contained in:
1 parent
a86b5f84ac
commit
bc88cd1e9d
1 file changed
+2
-5
+2
-5
@@ -85,15 +85,12 @@ function createUser(options) {
|
||||
return User.createLocalUser(result.email.trim(), result.password.trim(), result.displayName.trim())
|
||||
.then((user) => {
|
||||
console.log(`Created user ${user.id}.`);
|
||||
User
|
||||
|
||||
return User
|
||||
.addRoleToUser(user.id, result.role.trim())
|
||||
.then(() => {
|
||||
console.log(`Added the admin ${result.role.trim()} to User ${user.id}.`);
|
||||
util.shutdown();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
util.shutdown(1);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in new issue
Block a user