Skip to content

Commit 89d3a9d

Browse files
committed
fixed update method in PrivacyListProxy (v.2)
1 parent 7dbed3a commit 89d3a9d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

js/modules/qbChat.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,26 +1084,26 @@ PrivacyListProxy.prototype = {
10841084
},
10851085

10861086
update: function(list, callback) {
1087-
var self = this, copyList = list;
1087+
var self = this
10881088

1089-
self.getList(copyList.name, function(error, response) {
1089+
self.getList(list.name, function(error, response) {
10901090
if (error) {
10911091
callback(error, null);
10921092
}else{
1093-
var oldArray = response.items,
1093+
var copyList = (JSON.parse(JSON.stringify(list))),
1094+
oldArray = response.items,
10941095
newArray = copyList.items,
1095-
updatedArray = [],
1096-
createList = {};
1096+
updatedArray = [], createdList = {};
10971097

10981098
updatedArray = $.merge(oldArray, newArray);
10991099
copyList.items = updatedArray;
1100-
createList = copyList;
1100+
createdList = copyList;
11011101

1102-
self.create(createList, function(error, response) {
1102+
self.create(createdList, function(err, result) {
11031103
if (error) {
1104-
callback(error, null);
1104+
callback(err, null);
11051105
}else{
1106-
callback(null, createList);
1106+
callback(null, result);
11071107
}
11081108
});
11091109
}

0 commit comments

Comments
 (0)