Fix bug in adding item
This commit is contained in:
parent
35fcdaae54
commit
8b3dfb2984
1 changed files with 2 additions and 2 deletions
|
@ -207,8 +207,8 @@ app.get('/api/getitems', (req, res, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/api/item', (req, res, next) => {
|
app.post('/api/item', (req, res, next) => {
|
||||||
console.log('Post: /api/item');
|
console.log('Post: /api/item', req.body.item);
|
||||||
if ( req.body.item._id == '' ) {
|
if ( req.body.item._id == null ) {
|
||||||
const item = new itemmodel(req.body.item);
|
const item = new itemmodel(req.body.item);
|
||||||
item.save();
|
item.save();
|
||||||
res.status(201).json({
|
res.status(201).json({
|
||||||
|
|
Loading…
Reference in a new issue