From 2108a3b92b3334b95834aeaa32b308e47ac6cffb Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 18 Jun 2023 17:13:29 -0400 Subject: [PATCH] Improved error response for new node --- Server/controllers/nodesController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/controllers/nodesController.js b/Server/controllers/nodesController.js index bb5c081..9b7104e 100644 --- a/Server/controllers/nodesController.js +++ b/Server/controllers/nodesController.js @@ -25,7 +25,7 @@ exports.listAllNodes = async (req, res) => { // Add a new node to the storage exports.newNode = async (req, res) => { - if (!req.body.name) return res.send(400) + if (!req.body.name) return res.status(400).json("No name specified for new node"); try { // Try to add the new user with defaults if missing options