From 6ee435ffc796b2acecab764935e95974f8c8e172 Mon Sep 17 00:00:00 2001 From: dotansimha Date: Wed, 25 Jan 2017 00:25:42 +0200 Subject: [PATCH] Step 13.32: Add images to chats publication --- api/server/publications.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/server/publications.ts b/api/server/publications.ts index bddde20f4..4a0445f5f 100644 --- a/api/server/publications.ts +++ b/api/server/publications.ts @@ -80,7 +80,16 @@ Meteor.publishComposite('chats', function(): PublishCompositeConfig { }, { fields: { profile: 1 } }); - } + }, + children: [ + > { + find: (user, chat) => { + return Pictures.collection.find(user.profile.pictureId, { + fields: { url: 1 } + }); + } + } + ] } ] };