Improved error response for new node
This commit is contained in:
@@ -25,7 +25,7 @@ exports.listAllNodes = async (req, res) => {
|
|||||||
|
|
||||||
// Add a new node to the storage
|
// Add a new node to the storage
|
||||||
exports.newNode = async (req, res) => {
|
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 {
|
||||||
// Try to add the new user with defaults if missing options
|
// Try to add the new user with defaults if missing options
|
||||||
|
|||||||
Reference in New Issue
Block a user