(js) Fix error handling when renaming a mailbox

pull/212/head
Francis Lachapelle 2016-06-02 15:34:58 -04:00
parent 8f417cb10b
commit 8395a78f6d
2 changed files with 9 additions and 11 deletions

6
NEWS
View File

@ -1,3 +1,9 @@
3.1.2 (2016-MM-DD)
------------------
Bug fixes
- [web] fixed error handling when renaming a mailbox
3.1.1 (2016-06-02) 3.1.1 (2016-06-02)
------------------ ------------------

View File

@ -726,8 +726,8 @@
_this.$shadowData = _this.$omit(); _this.$shadowData = _this.$omit();
Mailbox.$log.debug(JSON.stringify(data, undefined, 2)); Mailbox.$log.debug(JSON.stringify(data, undefined, 2));
return data; return data;
}, function(data) { }, function(response) {
Mailbox.$log.error(JSON.stringify(data, undefined, 2)); Mailbox.$log.error(JSON.stringify(response.data, undefined, 2));
// Restore previous version // Restore previous version
_this.$reset(); _this.$reset();
}); });
@ -750,15 +750,7 @@
* @return an object literal copy of the Mailbox instance * @return an object literal copy of the Mailbox instance
*/ */
Mailbox.prototype.$omit = function() { Mailbox.prototype.$omit = function() {
var mailbox = {}; return { name: this.name };
angular.forEach(this, function(value, key) {
if (key != 'constructor' &&
key != 'children' &&
key[0] != '$') {
mailbox[key] = value;
}
});
return mailbox;
}; };
/** /**