@dhyasama/totem-models 4.5.2 → 4.5.3
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/Organization.js +1 -6
- package/package.json +1 -1
- package/test/Organization.js +547 -537
package/lib/Organization.js
CHANGED
|
@@ -594,27 +594,22 @@ module.exports = function(mongoose, config) {
|
|
|
594
594
|
|
|
595
595
|
// Check if this deal already exists
|
|
596
596
|
var dealMatch = _.find(self.deals, function(d) {
|
|
597
|
-
|
|
598
|
-
return cid == customer._id.toString();
|
|
597
|
+
return utils.getIdAsString(d, 'customer') == customer._id.toString();
|
|
599
598
|
});
|
|
600
599
|
|
|
601
600
|
// Update the deal
|
|
602
601
|
if (dealMatch) {
|
|
603
|
-
|
|
604
602
|
dealMatch.status = status;
|
|
605
603
|
dealMatch.history.push(historyEntry);
|
|
606
|
-
|
|
607
604
|
}
|
|
608
605
|
|
|
609
606
|
// Add the deal
|
|
610
607
|
else {
|
|
611
|
-
|
|
612
608
|
self.deals.push({
|
|
613
609
|
customer: customer,
|
|
614
610
|
status: status,
|
|
615
611
|
history: [historyEntry]
|
|
616
612
|
});
|
|
617
|
-
|
|
618
613
|
}
|
|
619
614
|
|
|
620
615
|
};
|