@dhyasama/totem-models 8.43.0 → 8.44.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/Organization.js +14 -0
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -1696,6 +1696,20 @@ module.exports = function(mongoose, config) {
|
|
|
1696
1696
|
|
|
1697
1697
|
};
|
|
1698
1698
|
|
|
1699
|
+
Organization.statics.removeCustomerValuations = function(customerId, cb) {
|
|
1700
|
+
|
|
1701
|
+
var self = this;
|
|
1702
|
+
|
|
1703
|
+
self
|
|
1704
|
+
.update(
|
|
1705
|
+
{ 'valuations.customer': customerId },
|
|
1706
|
+
{ $pull : { 'valuations': { 'customer': customerId } } },
|
|
1707
|
+
{ multi : true }
|
|
1708
|
+
)
|
|
1709
|
+
.exec(cb);
|
|
1710
|
+
|
|
1711
|
+
};
|
|
1712
|
+
|
|
1699
1713
|
Organization.statics.search = function search(data, options, cb) {
|
|
1700
1714
|
|
|
1701
1715
|
// search for orgs based on fields provided
|