Răsfoiți Sursa

Added spread operator to value in db update

mserranom 6 ani în urmă
părinte
comite
a7311ff5d3
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      services/notifications/app/js/Notifications.js

+ 1 - 1
services/notifications/app/js/Notifications.js

@@ -87,7 +87,7 @@ module.exports = Notifications = {
       }
       }
       return db.notifications.update(
       return db.notifications.update(
         { user_id: doc.user_id, key: notification.key },
         { user_id: doc.user_id, key: notification.key },
-        { $set : doc },
+        { $set : { ...doc } },
         { upsert: true },
         { upsert: true },
         callback
         callback
       )
       )