Fix bug with 'connected' key when adding new node to the server

This commit is contained in:
Logan Cusano
2023-06-18 19:02:15 -04:00
parent 2108a3b92b
commit 8dffeccf83
2 changed files with 2 additions and 5 deletions

View File

@@ -137,9 +137,8 @@ exports.addNewNode = async (nodeObject, callback) => {
port = nodeObject.port,
location = nodeObject.location,
nearbySystems = utils.JsonToBuffer(nodeObject.nearbySystems),
online = nodeObject.online,
connected = 0;
const sqlQuery = `INSERT INTO ${nodesTable} (name, ip, port, location, nearbySystems, online, connected) VALUES ('${name}', '${ip}', ${port}, '${location}', '${nearbySystems}', ${online}, ${connected})`;
online = nodeObject.online
const sqlQuery = `INSERT INTO ${nodesTable} (name, ip, port, location, nearbySystems, online) VALUES ('${name}', '${ip}', ${port}, '${location}', '${nearbySystems}', ${online})`;
const sqlResponse = await new Promise((recordResolve, recordReject) => {
runSQL(sqlQuery, (rows) => {