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');
|
res.redirect('/admin/product/new');
|
||||||
}else{
|
}else{
|
||||||
// get the new ID
|
// get the new ID
|
||||||
let newId = newDoc.insertedIds;
|
let newId = newDoc.insertedIds[0];
|
||||||
|
|
||||||
// add to lunr index
|
// add to lunr index
|
||||||
common.indexProducts(req.app)
|
common.indexProducts(req.app)
|
||||||
|
|
Loading…
Reference in New Issue