allow notes to be overwritten
This commit is contained in:
parent
004dfe44ec
commit
285979d777
1 changed files with 0 additions and 5 deletions
|
@ -177,14 +177,9 @@ module.exports = (db) => {
|
||||||
req.flash('error', 'Invalid user');
|
req.flash('error', 'Invalid user');
|
||||||
return res.redirect(`/wishlist/${req.params.user}`);
|
return res.redirect(`/wishlist/${req.params.user}`);
|
||||||
}
|
}
|
||||||
if (wishlistItem.note) {
|
|
||||||
req.flash('error', 'Already has a note');
|
|
||||||
return res.redirect(`/wishlist/${req.params.user}`);
|
|
||||||
} else {
|
|
||||||
wishlistItem.note = req.body.note;
|
wishlistItem.note = req.body.note;
|
||||||
wishlist[i] = wishlistItem;
|
wishlist[i] = wishlistItem;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
doc.wishlist = wishlist;
|
doc.wishlist = wishlist;
|
||||||
await db.put(doc);
|
await db.put(doc);
|
||||||
req.flash('success', 'Successfully added note!');
|
req.flash('success', 'Successfully added note!');
|
||||||
|
|
Loading…
Reference in a new issue