@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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
157
|
+
_id: id
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
query.exec(cb);
|