Skip to content

Commit

Permalink
Step 7.11: Added users publication
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Nov 28, 2016
1 parent 3b67c38 commit 7fb7a31
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/server/publications.ts
@@ -0,0 +1,17 @@
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { Users, Messages, Chats } from '../collections/whatsapp-collections';
import { User, Message, Chat } from 'api/models/whatsapp-models';

export function initPublications() {
Meteor.publish('users', function(): Mongo.Cursor<User> {
if (!this.userId) return;

return Users.collection.find({}, {
fields: {
profile: 1
}
});
});

}

0 comments on commit 7fb7a31

Please sign in to comment.