Skip to content

Commit

Permalink
Step 12.28: Added images to users publication
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Feb 13, 2017
1 parent 49af300 commit ac1a7d8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server/publications.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { Chats, Messages, Pictures, Users } from '../imports/collections';
import { Chat, Message, User } from '../imports/models';
import { Chat, Message, Picture, User } from '../imports/models';

Meteor.publishComposite('users', function(
pattern: string
Expand All @@ -24,7 +24,17 @@ Meteor.publishComposite('users', function(
fields: { profile: 1 },
limit: 15
});
}
},

children: [
<PublishCompositeConfig1<User, Picture>> {
find: (user) => {
return Pictures.collection.find(user.profile.pictureId, {
fields: { url: 1 }
});
}
}
]
};
});

Expand Down

0 comments on commit ac1a7d8

Please sign in to comment.