Fix crash after adding new product, similar to #3
parent
0b5320e924
commit
6f379b393d
|
@ -410,7 +410,7 @@ router.post('/product/insert', common.restrict, (req, res) => {
|
|||
res.redirect('/admin/product/new');
|
||||
}else{
|
||||
// get the new ID
|
||||
let newId = newDoc.insertedIds;
|
||||
let newId = newDoc.insertedIds[0];
|
||||
|
||||
// add to lunr index
|
||||
common.indexProducts(req.app)
|
||||
|
|
Loading…
Reference in New Issue