@dhyasama/totem-models 10.12.0 → 10.13.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.
Files changed (2) hide show
  1. package/lib/Account.js +12 -0
  2. package/package.json +1 -1
package/lib/Account.js CHANGED
@@ -324,6 +324,18 @@ module.exports = function(mongoose, config) {
324
324
 
325
325
  };
326
326
 
327
+ Account.statics.delete = function (id, options, cb) {
328
+
329
+ const self = this;
330
+
331
+ if (!cb) { throw new Error('cb is required'); }
332
+ if (!id) { return cb(new Error('id is required'), null); }
333
+ if (!mongoose.Types.ObjectId.isValid(id)) { return cb(new Error('id is not a valid ObjectId'), null); }
334
+
335
+ self.findByIdAndRemove(id, cb);
336
+
337
+ };
338
+
327
339
  Account.statics.upsert = function(account, cb) {
328
340
 
329
341
  // No population so no need to scrub
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "10.12.0",
3
+ "version": "10.13.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",