Skip to content

Commit

Permalink
Step 7.12: Added messages publication
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Nov 28, 2016
1 parent 7fb7a31 commit 7159c4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/server/publications.ts
Expand Up @@ -14,4 +14,11 @@ export function initPublications() {
});
});

Meteor.publish('messages', function(chatId: string): Mongo.Cursor<Message> {
if (!this.userId) return;
if (!chatId) return;

return Messages.collection.find({chatId});
});

}

0 comments on commit 7159c4d

Please sign in to comment.