@dhyasama/totem-models 9.101.0 → 9.102.1
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.
|
@@ -137,6 +137,16 @@ module.exports = function(mongoose, config) {
|
|
|
137
137
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
LimitedPartnerCommunication.statics.getByPostmarkMessageId = function getByPostmarkMessageId(postmarkMessageId, cb) {
|
|
141
|
+
|
|
142
|
+
const self = this;
|
|
143
|
+
|
|
144
|
+
const query = self.findOne({ postmarkMessageId: postmarkMessageId });
|
|
145
|
+
|
|
146
|
+
query.exec(cb);
|
|
147
|
+
|
|
148
|
+
};
|
|
149
|
+
|
|
140
150
|
LimitedPartnerCommunication.statics.getUnsentByCampaigns = function getUnsentByCampaigns(campaignIds, options, cb) {
|
|
141
151
|
|
|
142
152
|
const self = this;
|
|
@@ -171,7 +181,7 @@ module.exports = function(mongoose, config) {
|
|
|
171
181
|
const self = this;
|
|
172
182
|
|
|
173
183
|
if (!cb) throw new Error('cb is required');
|
|
174
|
-
if (!
|
|
184
|
+
if (!conditions) { return cb(new Error('update is required'), null); }
|
|
175
185
|
if (!update) { return cb(new Error('update is required'), null); }
|
|
176
186
|
|
|
177
187
|
const query = self.findOneAndUpdate(conditions, update, { upsert: false, new: true });
|