Fix bug in getUsers
This commit is contained in:
parent
2793e591e6
commit
61e4193455
|
@ -441,13 +441,16 @@ async function assignFirstMatch(teamId, tournamentId) {
|
||||||
|
|
||||||
function getUsers () {
|
function getUsers () {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
connection.query("SELECT * FROM users", (err, users) => {
|
connection.query("SELECT * FROM users", (err, userRows) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
users.forEach((user, index) => {
|
let users = [];
|
||||||
this[index].isManager = (this[index].isManager == 1);
|
userRows.forEach((userRow, index) => {
|
||||||
|
let user = results=JSON.parse(JSON.stringify(userRow))
|
||||||
|
user.isManager = user.isManager == 1;
|
||||||
|
users.push(user);
|
||||||
});
|
});
|
||||||
resolve(users);
|
resolve(users);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue