@dhyasama/totem-models 1.21.1 → 1.22.0
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/Round.js +16 -4
- package/package.json +1 -1
- package/.npmignore +0 -14
package/lib/Round.js
CHANGED
|
@@ -513,7 +513,8 @@ module.exports = function(mongoose, config) {
|
|
|
513
513
|
var self = this;
|
|
514
514
|
|
|
515
515
|
var query = self.find({ 'vehicles.fund': fundId });
|
|
516
|
-
query.select('vehicles');
|
|
516
|
+
query.select('organization roundName vehicles');
|
|
517
|
+
query.populate('organization', 'name logoUrl');
|
|
517
518
|
|
|
518
519
|
if (config.CUSTOMER_ID == 'GLOBAL_PROCESS') {
|
|
519
520
|
query.populate('vehicles.investments');
|
|
@@ -530,10 +531,21 @@ module.exports = function(mongoose, config) {
|
|
|
530
531
|
if (err) return cb(err, null);
|
|
531
532
|
if (!rounds) return cb(null, []);
|
|
532
533
|
|
|
533
|
-
var
|
|
534
|
-
|
|
534
|
+
var fundInvestments = [];
|
|
535
|
+
|
|
536
|
+
_.each(rounds, function(round) {
|
|
537
|
+
_.each(round.vehicles, function(vehicle) {
|
|
538
|
+
if(vehicle.fund == fundId) {
|
|
539
|
+
_.each(vehicle.investments, function(investment) {
|
|
540
|
+
investment.organization = round.organization;
|
|
541
|
+
investment.roundName = round.roundName;
|
|
542
|
+
fundInvestments.push(investment);
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
});
|
|
535
547
|
|
|
536
|
-
return cb(null,
|
|
548
|
+
return cb(null, fundInvestments);
|
|
537
549
|
|
|
538
550
|
});
|
|
539
551
|
|
package/package.json
CHANGED