@dhyasama/totem-models 1.20.0 → 1.20.1

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.
@@ -444,6 +444,28 @@ module.exports = function(mongoose, config) {
444
444
 
445
445
  };
446
446
 
447
+ LimitedPartner.statics.getFlags = function getFlags(lpid, cb) {
448
+
449
+ var self = this;
450
+ var query = self.findById(lpid)
451
+
452
+ query.select('flags')
453
+ query.populate({
454
+ path: 'flags',
455
+ match: { customer: config.CUSTOMER_ID }
456
+ })
457
+ query.deepPopulate([
458
+ 'flags.createdBy',
459
+ ], {
460
+ populate: {
461
+ 'flags.createdBy': { select: 'name avatarUrl title' }
462
+ }
463
+ })
464
+ query.sort({'createdOn':-1})
465
+ query.exec(cb);
466
+
467
+ };
468
+
447
469
  LimitedPartner.statics.getNotes = function getNotes(lpid, cb) {
448
470
 
449
471
  var self = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",