Przeglądaj źródła

Don't 'add' association, use 'set'

sbkwgh 8 lat temu
rodzic
commit
b94b4c9dbc
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      models/Notification.js

+ 4 - 4
models/Notification.js

@@ -25,11 +25,11 @@ module.exports = (sequelize, DataTypes) => {
 				let notification = await Notification.create({ type: 'mention' })
 				let mentionNotification = await MentionNotification.create()
 
-				await mentionNotification.addUser(props.user)
-				await mentionNotification.addPost(props.post)
+				await mentionNotification.setUser(props.user)
+				await mentionNotification.setPost(props.post)
 
-				await notification.addMentionNotification(mentionNotification)
-				await notification.addUser(user)
+				await notification.setMentionNotification(mentionNotification)
+				await notification.setUser(user)
 
 				return notification
 			}