Improved error response for new node

This commit is contained in:
Logan Cusano
2023-06-18 17:13:29 -04:00
parent 960b801dd2
commit 2108a3b92b

View File

@@ -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