@dhyasama/totem-models 3.9.0 → 3.10.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 +15 -1
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -650,6 +650,20 @@ module.exports = function(mongoose, config) {
|
|
|
650
650
|
|
|
651
651
|
};
|
|
652
652
|
|
|
653
|
+
Organization.statics.removeCustomerFilters = function(customerId, cb) {
|
|
654
|
+
|
|
655
|
+
var self = this;
|
|
656
|
+
|
|
657
|
+
self
|
|
658
|
+
.update(
|
|
659
|
+
{ 'filters.customer': customerId },
|
|
660
|
+
{ $pull : { 'filters': { 'customer': customerId } } },
|
|
661
|
+
{ multi : true }
|
|
662
|
+
)
|
|
663
|
+
.exec(cb);
|
|
664
|
+
|
|
665
|
+
};
|
|
666
|
+
|
|
653
667
|
Organization.statics.findByDomains = function findByDomains(domains, cb) {
|
|
654
668
|
domains = domains.map(function(domain){ return domain.toLowerCase() })
|
|
655
669
|
var query = this.find({ $or: [ {'website': { $in : domains }}, {'websiteAliases': { $in : domains }} ], 'deleted': {$ne: true} });
|
|
@@ -833,7 +847,7 @@ module.exports = function(mongoose, config) {
|
|
|
833
847
|
if (config.CUSTOMER_ID != 'GLOBAL_PROCESS') lpPopulateOptions.match = { customer: config.CUSTOMER_ID };
|
|
834
848
|
|
|
835
849
|
var query = self.findById(id);
|
|
836
|
-
query.populate('people.person', 'name avatarUrl title doNotDisplay');
|
|
850
|
+
query.populate('people.person', 'name avatarUrl title contact doNotDisplay');
|
|
837
851
|
query.populate('related', 'name logoUrl');
|
|
838
852
|
query.populate('chairs.first', 'name avatarUrl title');
|
|
839
853
|
query.populate('chairs.second', 'name avatarUrl title');
|