@dhyasama/totem-models 11.36.0 → 11.38.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/LimitedPartner.js +14 -10
- package/package.json +1 -1
package/lib/LimitedPartner.js
CHANGED
|
@@ -446,11 +446,13 @@ module.exports = function(mongoose, config) {
|
|
|
446
446
|
|
|
447
447
|
});
|
|
448
448
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return
|
|
449
|
+
if (options.fundids) {
|
|
450
|
+
lp.transactions = _.filter(lp.transactions, function(transaction) {
|
|
451
|
+
return _.find(options.fundids, function(f) {
|
|
452
|
+
return transaction.fund._id.toString() === f.toString();
|
|
453
|
+
});
|
|
452
454
|
});
|
|
453
|
-
}
|
|
455
|
+
}
|
|
454
456
|
|
|
455
457
|
return cb(null, lp);
|
|
456
458
|
|
|
@@ -661,7 +663,7 @@ module.exports = function(mongoose, config) {
|
|
|
661
663
|
query = self.find({}, getReadFilterKeys(options.role));
|
|
662
664
|
}
|
|
663
665
|
else {
|
|
664
|
-
query = self.find({ 'transactions.fund': { $in : options.
|
|
666
|
+
query = self.find({ 'transactions.fund': { $in : options.fundids }, customer: customerId }, getReadFilterKeys(options.role));
|
|
665
667
|
}
|
|
666
668
|
|
|
667
669
|
query.populate('transactions.fund');
|
|
@@ -671,13 +673,15 @@ module.exports = function(mongoose, config) {
|
|
|
671
673
|
|
|
672
674
|
if (err) return cb(err);
|
|
673
675
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
return
|
|
676
|
+
if (options.fundids) {
|
|
677
|
+
_.each(result, function(lp) {
|
|
678
|
+
lp.transactions = _.filter(lp.transactions, function(transaction) {
|
|
679
|
+
return _.find(options.fundids, function(f) {
|
|
680
|
+
return transaction.fund._id.toString() === f.toString();
|
|
681
|
+
});
|
|
678
682
|
});
|
|
679
683
|
});
|
|
680
|
-
}
|
|
684
|
+
}
|
|
681
685
|
|
|
682
686
|
return cb(null, result);
|
|
683
687
|
|