Skip to content

Commit 18ee0ad

Browse files
committedJan 22, 2020
[api] count user merges
1 parent 3a947f0 commit 18ee0ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎api/parts/mgmt/app_users.js

+6
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ usersApi.merge = function(app_id, newAppUser, new_id, old_id, new_device_id, old
404404
}
405405
//store last merged uid for reference
406406
newAppUserP.merged_uid = oldAppUser.uid;
407+
if (typeof newAppUserP.merges === "undefined") {
408+
newAppUserP.merges = 1;
409+
}
410+
if (typeof oldAppUser.merges !== "undefined") {
411+
newAppUserP.merges += oldAppUser.merges;
412+
}
407413
//update new user
408414
common.db.collection('app_users' + app_id).update({_id: newAppUserP._id}, {'$set': newAppUserP}, function() {
409415
//delete old user

0 commit comments

Comments
 (0)
Please sign in to comment.