@dhyasama/totem-models 8.0.5 → 8.0.6

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.
@@ -1116,8 +1116,13 @@ module.exports = function(mongoose, config) {
1116
1116
  if (!cb) { throw new Error('cb is required'); }
1117
1117
  if (!ids) { return cb(new Error('ids is required'), null); }
1118
1118
  if (!options) { return cb(new Error('options is required'), null); }
1119
- if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
1120
- if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
1119
+
1120
+ options = helpers.getDefaultOptions(options);
1121
+
1122
+ if (!options.isWorkerProcess) {
1123
+ if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
1124
+ if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
1125
+ }
1121
1126
 
1122
1127
  self
1123
1128
  .find({ '_id': { $in : ids }})
@@ -1126,9 +1131,11 @@ module.exports = function(mongoose, config) {
1126
1131
  if (err) { return cb(err, null); }
1127
1132
  else if (!orgs) { return cb(null, []); }
1128
1133
 
1129
- orgs = _.map(orgs, function(org) {
1130
- return helpers.cleanOrg(org, options.CUSTOMER_ID);
1131
- });
1134
+ if (!options.isWorkerProcess) {
1135
+ orgs = _.map(orgs, function(org) {
1136
+ return helpers.cleanOrg(org, options.CUSTOMER_ID);
1137
+ });
1138
+ }
1132
1139
 
1133
1140
  return cb(null, orgs);
1134
1141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",