Skip to content

Commit

Permalink
Step 13.31: Added images to users publication
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Oct 16, 2017
1 parent 029b7d6 commit 40c9a2c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions api/server/publications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User, Message, Chat } from './models';
import { User, Message, Chat, Picture } from './models';
import { Users } from './collections/users';
import { Messages } from './collections/messages';
import { Chats } from './collections/chats';
Expand All @@ -25,7 +25,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 40c9a2c

Please sign in to comment.