@dhyasama/totem-models 11.43.0 → 11.45.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/Account.js CHANGED
@@ -261,6 +261,24 @@ module.exports = function(mongoose, config) {
261
261
 
262
262
  };
263
263
 
264
+ Account.statics.updateOrg = function(email, customerId, cb) {
265
+
266
+ if (!cb) { throw new Error('cb is required'); }
267
+ if (!email) { return cb(new Error('email is required'), null); }
268
+ if (!customerId) { return cb(new Error('customerId is required'), null); }
269
+ if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
270
+
271
+ const self = this;
272
+
273
+ self.updateOne({ email: email }, { $set: { org: customerId } }, function(err, res) {
274
+
275
+ if (err) { return cb(err, null); }
276
+ cb(null, res);
277
+
278
+ });
279
+
280
+ };
281
+
264
282
  Account.statics.listAdminAccounts = function (options, cb) {
265
283
 
266
284
  const self = this;
@@ -864,7 +864,8 @@ module.exports = function(mongoose, config) {
864
864
  query: value,
865
865
  path: [
866
866
  'name',
867
- 'stakeholders'
867
+ 'stakeholders',
868
+ 'details.value'
868
869
  ],
869
870
  fuzzy: {
870
871
  maxEdits: options.maxEdits,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.43.0",
3
+ "version": "11.45.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",