Add new node if node tries to check in with an ID not in the DB

This commit is contained in:
Logan Cusano
2023-07-21 18:51:55 -04:00
committed by logan
parent 9ff87403b2
commit d847aa4fc7

View File

@@ -269,6 +269,7 @@ exports.updateExistingNode = async = (req, res) => {
exports.nodeCheckIn = async (req, res) => {
if (!req.params.nodeId) return res.status(400).json("No id specified");
getNodeInfoFromId(req.params.nodeId, (nodeInfo) => {
if (!nodeInfo) return this.newNode(req, res);
if (!nodeInfo.online) {
nodeInfo.online = true;
updateNodeInfo(nodeInfo, () => {