automatic image/price

This commit is contained in:
Wingy 2020-11-02 23:28:05 -05:00
parent c71d654847
commit fdc3c814d0

View file

@ -84,6 +84,8 @@ module.exports = (db) => {
req.flash('error', err.toString()); req.flash('error', err.toString());
} }
item.name = (productData ? productData.name : ''); item.name = (productData ? productData.name : '');
item.price = productData?.price
item.image = productData?.image
item.addedBy = req.user._id; item.addedBy = req.user._id;
item.pledgedBy = (req.user._id === req.params.user ? undefined : req.user._id); item.pledgedBy = (req.user._id === req.params.user ? undefined : req.user._id);
item.note = req.body.note; item.note = req.body.note;