@dhyasama/totem-models 8.51.0 → 8.52.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.
@@ -657,6 +657,24 @@ module.exports = function(mongoose, config) {
657
657
 
658
658
  };
659
659
 
660
+ LimitedPartner.statics.removeCustomerPeople = function removeCustomerPeople(customerId, cb) {
661
+
662
+ const self = this;
663
+
664
+ if (!cb) { throw new Error('cb is required'); }
665
+ if (!customerId) { return cb(new Error('customerId is required'), null); }
666
+ if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
667
+
668
+ let query = self.update(
669
+ { 'customer': customerId },
670
+ { $set: { people: [] } },
671
+ { multi : true }
672
+ );
673
+
674
+ query.exec(cb);
675
+
676
+ };
677
+
660
678
  LimitedPartner.statics.search = function (terms, options, cb) {
661
679
 
662
680
  const self = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.51.0",
3
+ "version": "8.52.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",