Fix crash after adding new product, similar to #3

react_convert
arings 2018-02-02 21:20:33 +01:00
parent 0b5320e924
commit 6f379b393d
1 changed files with 1 additions and 1 deletions

View File

@ -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)