1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-02 16:58:43 +09:00
This commit is contained in:
syuilo 2017-11-01 04:32:18 +09:00
parent c5d5f7cef3
commit b60ed8f20c

View File

@ -228,13 +228,6 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
// -----------------------------------------------------------
// Post processes
if (channel) {
Channel.update({ _id: channel._id }, {
$inc: {
index: 1
}
});
}
User.update({ _id: user._id }, {
$set: {
@ -260,8 +253,15 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
// Publish event to myself's stream
event(user._id, 'post', postObj);
// Publish event to channel
if (channel) {
// Increment channel index(posts count)
Channel.update({ _id: channel._id }, {
$inc: {
index: 1
}
});
// Publish event to channel
publishChannelStream(channel._id, 'post', postObj);
}