Permalink
Browse files

Step 13.31: Added images to users publication

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 029b7d6 commit 40c9a2c876e120097365cc72abf3b55e1cedc197
Showing with 12 additions and 2 deletions.
  1. +12 −2 api/server/publications.ts
@@ -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';
@@ -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 }
});
}
}
]
};
});

0 comments on commit 40c9a2c

Please sign in to comment.