From 8b3dfb29842128476788bc74ea442bc44c252b8a Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Tue, 26 Oct 2021 15:07:10 -0500 Subject: [PATCH] Fix bug in adding item --- backend/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app.js b/backend/app.js index 50ac325..22a075d 100644 --- a/backend/app.js +++ b/backend/app.js @@ -207,8 +207,8 @@ app.get('/api/getitems', (req, res, next) => { }); app.post('/api/item', (req, res, next) => { - console.log('Post: /api/item'); - if ( req.body.item._id == '' ) { + console.log('Post: /api/item', req.body.item); + if ( req.body.item._id == null ) { const item = new itemmodel(req.body.item); item.save(); res.status(201).json({