Fix bug in adding item

This commit is contained in:
Rene Vergara 2021-10-26 15:07:10 -05:00
parent 35fcdaae54
commit 8b3dfb2984

View file

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