@dhyasama/totem-models 8.0.7 → 8.0.8
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 +5 -0
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -1349,6 +1349,11 @@ module.exports = function(mongoose, config) {
|
|
|
1349
1349
|
|
|
1350
1350
|
options = helpers.getDefaultOptions(options);
|
|
1351
1351
|
|
|
1352
|
+
if (!options.isWorkerProcess) {
|
|
1353
|
+
if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
|
|
1354
|
+
if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1352
1357
|
let lpPopulateOptions = { path: 'lps' };
|
|
1353
1358
|
if (!options.isWorkerProcess) { lpPopulateOptions.match = { customer: options.CUSTOMER_ID }; }
|
|
1354
1359
|
|