@dhyasama/totem-models 8.0.4 → 8.0.5
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/Person.js +5 -2
- package/package.json +2 -2
package/lib/Person.js
CHANGED
|
@@ -377,11 +377,14 @@ module.exports = function(mongoose, config) {
|
|
|
377
377
|
if (!id) { return cb(new Error('id is required'), null); }
|
|
378
378
|
if (!mongoose.Types.ObjectId.isValid(id)) { return cb(new Error('id is not a valid ObjectId'), null); }
|
|
379
379
|
if (!options) { return cb(new Error('options is required'), null); }
|
|
380
|
-
if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
|
|
381
|
-
if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
|
|
382
380
|
|
|
383
381
|
options = helpers.getDefaultOptions(options);
|
|
384
382
|
|
|
383
|
+
if (!options.isWorkerProcess) {
|
|
384
|
+
if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
|
|
385
|
+
if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
|
|
386
|
+
}
|
|
387
|
+
|
|
385
388
|
self
|
|
386
389
|
.findById(id)
|
|
387
390
|
.select('-previous')
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhyasama/totem-models",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5",
|
|
4
4
|
"author": "Jason Reynolds",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "Models for Totem platform",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": "12.
|
|
9
|
+
"node": ">=12.0.0"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"test": "NODE_ENV=test mocha -R spec -t 15000 --exit"
|