@dhyasama/totem-models 6.33.2 → 6.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Deal.js +10 -2
- package/package.json +1 -1
package/lib/Deal.js
CHANGED
|
@@ -147,7 +147,7 @@ module.exports = function(mongoose, config) {
|
|
|
147
147
|
'_id': id,
|
|
148
148
|
'customer': config.CUSTOMER_ID
|
|
149
149
|
})
|
|
150
|
-
.populate('organization', 'name logoUrl website websiteAliases')
|
|
150
|
+
.populate('organization', 'name description logoUrl website websiteAliases chairs')
|
|
151
151
|
.populate('messages')
|
|
152
152
|
.populate('source.person', 'name avatarUrl title')
|
|
153
153
|
.populate('referrer.person', 'name avatarUrl title')
|
|
@@ -156,7 +156,15 @@ module.exports = function(mongoose, config) {
|
|
|
156
156
|
match: { customer: config.CUSTOMER_ID }
|
|
157
157
|
})
|
|
158
158
|
.populate('history.account', 'person')
|
|
159
|
-
.exec(
|
|
159
|
+
.exec(function(err, deal) {
|
|
160
|
+
|
|
161
|
+
if (err) return cb(err, null);
|
|
162
|
+
|
|
163
|
+
deal.deepPopulate('organization.chairs.first', {
|
|
164
|
+
populate: { 'organization.chairs.first': { select: 'name avatarUrl title doNotDisplay' } }
|
|
165
|
+
}, cb);
|
|
166
|
+
|
|
167
|
+
});
|
|
160
168
|
|
|
161
169
|
};
|
|
162
170
|
|