@dhyasama/totem-models 8.8.3 → 8.8.5
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/Interaction.js +5 -11
- package/package.json +1 -1
package/lib/Interaction.js
CHANGED
|
@@ -28,20 +28,14 @@ module.exports = function(mongoose, config) {
|
|
|
28
28
|
|
|
29
29
|
///////////////////////////////////////
|
|
30
30
|
|
|
31
|
-
Interaction.statics.addNote = function(interactionId, creatorPersonId, text, isPrivate, cb) {
|
|
31
|
+
Interaction.statics.addNote = function(interactionId, creatorPersonId, text, isPrivate, customerId, cb) {
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
if (!interactionId) { return cb(new Error('interactionId is required'), null); }
|
|
35
|
-
if (!mongoose.Types.ObjectId.isValid(interactionId)) { return cb(new Error('interactionId is not a valid ObjectId'), null); }
|
|
36
|
-
if (!creatorPersonId) { return cb(new Error('creatorPersonId is required'), null); }
|
|
37
|
-
if (!mongoose.Types.ObjectId.isValid(creatorPersonId)) { return cb(new Error('creatorPersonId is not a valid ObjectId'), null); }
|
|
38
|
-
if (!text) { return cb(new Error('text is required'), null); }
|
|
39
|
-
|
|
40
|
-
Note.createForModel({
|
|
33
|
+
Interaction.createForModel({
|
|
41
34
|
createdBy: creatorPersonId,
|
|
42
35
|
text: text,
|
|
43
|
-
isPrivate: isPrivate
|
|
44
|
-
|
|
36
|
+
isPrivate: isPrivate,
|
|
37
|
+
customer: customerId
|
|
38
|
+
}, this, interactonId, cb);
|
|
45
39
|
|
|
46
40
|
};
|
|
47
41
|
|