0
0
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:
G.Ambatte
2023-01-15 23:28:54 +13:00
parent ccd5cacb0c
commit 24adbdc429

View File

@@ -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)=>{