0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 08:42:42 +00:00

Finally testing, things should be working a bit better now

This commit is contained in:
Scott Tolksdorf
2017-01-01 13:31:33 -08:00
parent 95c09ba7ad
commit 5ba3f98696
8 changed files with 70 additions and 84 deletions

View File

@@ -88,10 +88,9 @@ const BrewData = {
return newBrew.save();
},
update : (newBrew) => {
return Brew.findOneAndUpdate({ editId : newBrew.editId }, {
...newBrew,
updatedAt : Date.now()
}, {new : true, upsert : true}).exec(); //TODO: TEST THIS that this returns a reocrd
return Brew.findOneAndUpdate({ editId : newBrew.editId },
_.merge(newBrew, { updatedAt : Date.now() }),
{new : true, upsert : true}).exec(); //TODO: TEST THIS that this returns a reocrd
},
remove : (editId) => {
return Brew.find({ editId }).remove().exec();