@dhyasama/totem-merge 7.0.2 → 7.0.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/organizations.js +3 -2
- package/lib/people.js +1 -1
- package/package.json +1 -1
package/lib/organizations.js
CHANGED
|
@@ -84,8 +84,9 @@ var merge = function merge(context, target, source, mergedBy, customerId, cb) {
|
|
|
84
84
|
var updatedReferencesOrgs = results[6][5];
|
|
85
85
|
|
|
86
86
|
// Check if target had reference(s) updated
|
|
87
|
-
var
|
|
88
|
-
|
|
87
|
+
var targetIdStr = target.id && target.id.toString();
|
|
88
|
+
var targetMatch = targetIdStr && _.find(updatedReferencesOrgs, function(o) {
|
|
89
|
+
return o && o.id && o.id.toString() === targetIdStr;
|
|
89
90
|
});
|
|
90
91
|
|
|
91
92
|
// Return up to date target
|
package/lib/people.js
CHANGED
|
@@ -451,7 +451,7 @@ var updateNotes = function updateNotes(newPersonId, oldPersonId, user, cb) {
|
|
|
451
451
|
|
|
452
452
|
var setObj = {};
|
|
453
453
|
|
|
454
|
-
if (item.createdBy.toString() === oldPersonId.toString()) { setObj.createdBy = newPersonId; }
|
|
454
|
+
if (item.createdBy && item.createdBy.toString && item.createdBy.toString() === oldPersonId.toString()) { setObj.createdBy = newPersonId; }
|
|
455
455
|
|
|
456
456
|
tasks.push({
|
|
457
457
|
id: item._id,
|