From 24adbdc429f8127d125f779effaf183baec35771 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 15 Jan 2023 23:28:54 +1300 Subject: [PATCH] Change model to use defaults rather than mergeWith --- server/notifications.model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notifications.model.js b/server/notifications.model.js index 721c4a89d..bd74ad5b7 100644 --- a/server/notifications.model.js +++ b/server/notifications.model.js @@ -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)=>{