소스 검색

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

sbkwgh 8 년 전
부모
커밋
b94b4c9dbc
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  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
 			}