@dhyasama/totem-models 6.8.9 → 6.8.10

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.
Files changed (2) hide show
  1. package/lib/Round.js +14 -1
  2. package/package.json +1 -1
package/lib/Round.js CHANGED
@@ -160,6 +160,7 @@ module.exports = function(mongoose, config) {
160
160
  filters: rounds[0].organization.filters,
161
161
  status: rounds[0].organization.status,
162
162
  preMoneyValuation: rounds[0].preMoneyValuation,
163
+ chairs: rounds[0].organization.chairs,
163
164
  funds: funds
164
165
  };
165
166
 
@@ -644,7 +645,16 @@ module.exports = function(mongoose, config) {
644
645
 
645
646
  var query = self.find({ 'vehicles.fund': { $in: fundIds } });
646
647
  query.select('organization vehicles preMoneyValuation');
647
- query.populate('organization', 'name logoUrl description contact filters status ipo closed acquired operating website websiteAliases');
648
+ query.populate('organization', 'name logoUrl description contact chairs filters status ipo closed acquired operating website websiteAliases');
649
+ query.deepPopulate([
650
+ 'organization.chairs.first',
651
+ 'organization.chairs.second',
652
+ ], {
653
+ populate: {
654
+ 'organization.chairs.first': { select: 'name avatarUrl title doNotDisplay' },
655
+ 'organization.chairs.second': { select: 'name avatarUrl title doNotDisplay' },
656
+ }
657
+ });
648
658
  query.populate('vehicles.fund');
649
659
 
650
660
  if (config.CUSTOMER_ID == 'GLOBAL_PROCESS') {
@@ -902,6 +912,9 @@ module.exports = function(mongoose, config) {
902
912
  Round.index({ organization: 1, roundName: 1 }, { unique: true, partialFilterExpression : { type :"string" } });
903
913
  Round.on('index', function(err) { console.log('error building Round indexes: ' + err); });
904
914
 
915
+ var deepPopulate = require('mongoose-deep-populate')(mongoose);
916
+ Round.plugin(deepPopulate);
917
+
905
918
  mongoose.model('Round', Round);
906
919
 
907
920
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "6.8.9",
3
+ "version": "6.8.10",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",