Add new node if node tries to check in with an ID not in the DB
This commit is contained in:
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user