bugfix: delete logged in user

This commit is contained in:
Felix Albrigtsen 2022-04-25 14:01:23 +02:00
parent 01d280dba3
commit 814ddbf2ca
1 changed files with 9 additions and 5 deletions

View File

@ -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");
}
} }
}); });
}); });