Explorar o código

Added spread operator to value in db update

mserranom %!s(int64=6) %!d(string=hai) anos
pai
achega
a7311ff5d3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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(
         { user_id: doc.user_id, key: notification.key },
-        { $set : doc },
+        { $set : { ...doc } },
         { upsert: true },
         callback
       )