bugfix: delete logged in user
This commit is contained in:
parent
01d280dba3
commit
814ddbf2ca
|
@ -485,13 +485,17 @@ function getUserByGoogleId(googleId) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
if (users.length == 0) {
|
if (!users || users.length == 0) {
|
||||||
reject("No such user exists");
|
reject("No such user exists");
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
users[0].isManager = users[0].isManager == 1;
|
users[0].isManager = users[0].isManager == 1;
|
||||||
users[0].asuraId = users[0].id;
|
users[0].asuraId = users[0].id;
|
||||||
users[0].id = undefined;
|
users[0].id = undefined;
|
||||||
resolve(users[0]);
|
resolve(users[0]);
|
||||||
|
} catch (e) {
|
||||||
|
reject("No such user exists");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue