Fix bug in return from addNewNode
- Return the function to get a node from the ID since the add new doesn't return node rows - Update the controller to send the correct key from the updated object
This commit is contained in:
@@ -38,9 +38,9 @@ exports.newNode = async (req, res) => {
|
||||
_online: req.body.online ?? 0
|
||||
});
|
||||
|
||||
addNewNode(newNode, (queryResults) => {
|
||||
addNewNode(newNode, (newNodeObject) => {
|
||||
// Send back a success if the user has been added and the ID for the client to keep track of
|
||||
res.status(202).json({"nodeId": queryResults.insertId});
|
||||
res.status(202).json({"nodeId": newNodeObject.id});
|
||||
})
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user