This commit is contained in:
syuilo
2018-06-02 16:01:32 +09:00
parent 8dfd892b71
commit 4feff8835c
6 changed files with 27 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ export default async function(follower: IUser, followee: IUser) {
}
});
User.update({ _id: followee._id }, {
await User.update({ _id: followee._id }, {
$inc: {
pendingReceivedFollowRequestsCount: 1
}
@@ -33,7 +33,11 @@ export default async function(follower: IUser, followee: IUser) {
// Publish reciveRequest event
if (isLocalUser(followee)) {
packUser(follower, followee).then(packed => event(followee._id, 'reciveFollowRequest', packed)),
packUser(follower, followee).then(packed => event(followee._id, 'reciveFollowRequest', packed));
packUser(followee, followee, {
detail: true
}).then(packed => event(followee._id, 'meUpdated', packed));
// 通知を作成
notify(followee._id, follower._id, 'reciveFollowRequest');