@dhyasama/totem-models 9.65.0 → 9.67.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/index.js CHANGED
@@ -56,6 +56,7 @@ var bootstrap = function(mongoose, config) {
56
56
  require('./lib/Interaction.js')(mongoose, config);
57
57
  require('./lib/Investment.js')(mongoose, config);
58
58
  require('./lib/List.js')(mongoose, config);
59
+ require('./lib/LimitedPartnerCampaign.js')(mongoose, config);
59
60
  require('./lib/LimitedPartnerContactGroup.js')(mongoose, config);
60
61
  require('./lib/LimitedPartnerCommunication.js')(mongoose, config);
61
62
  require('./lib/Message.js')(mongoose, config);
@@ -39,7 +39,7 @@ module.exports = function(mongoose, config) {
39
39
  if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
40
40
 
41
41
  const query = self.findOne({
42
- id: campaignId,
42
+ _id: campaignId,
43
43
  customer: customerId
44
44
  });
45
45
 
@@ -116,7 +116,7 @@ module.exports = function(mongoose, config) {
116
116
  if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
117
117
 
118
118
  const query = self.findOneAndRemove({
119
- id: campaignId,
119
+ _id: campaignId,
120
120
  customer: customerId
121
121
  });
122
122
 
@@ -137,7 +137,7 @@ module.exports = function(mongoose, config) {
137
137
  if (!campaignId) { return cb(new Error('campaignId is required'), null); }
138
138
  if (!mongoose.Types.ObjectId.isValid(campaignId)) { return cb(new Error('campaignId is not a valid ObjectId'), null); }
139
139
 
140
- const query = self.deleteMany({
140
+ const query = self.remove({
141
141
  campaign: campaignId
142
142
  });
143
143
 
@@ -154,7 +154,7 @@ module.exports = function(mongoose, config) {
154
154
  if (!mongoose.Types.ObjectId.isValid(id)) { return cb(new Error('id is not a valid ObjectId'), null); }
155
155
 
156
156
  const query = self.findByIdAndRemove({
157
- id: id
157
+ _id: id
158
158
  });
159
159
 
160
160
  query.exec(cb);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "9.65.0",
3
+ "version": "9.67.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",