mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 12:02:48 +00:00
Change model to use defaults rather than mergeWith
This commit is contained in:
@@ -39,7 +39,7 @@ NotificationSchema.statics.addNotification = async function(data){
|
||||
startAt : new Date,
|
||||
stopAt : new Date
|
||||
};
|
||||
_.mergeWith(data, defaults, (item)=>{ if(!item) return undefined; });
|
||||
_.defaults(data, defaults);
|
||||
const newNotification = new Notification(data);
|
||||
const savedNotification = await newNotification.save()
|
||||
.catch((err)=>{
|
||||
|
||||
Reference in New Issue
Block a user