no item.name if not productData

This commit is contained in:
Sam Wing 2019-11-18 20:38:53 -05:00
parent 842f694ff0
commit 18cbc44656

View file

@ -79,7 +79,7 @@ module.exports = (db) => {
} catch (err) { } catch (err) {
req.flash('error', err.toString()); req.flash('error', err.toString());
} }
item.name = (productData ? productData.name : req.body.itemUrlOrName); item.name = (productData ? productData.name : '');
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;