From cef9a501246398e799154c75f5b92933c955d76c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 17 Sep 2013 15:49:41 +0200 Subject: account deletion fix --- pyload/web/app/scripts/models/Account.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pyload/web') diff --git a/pyload/web/app/scripts/models/Account.js b/pyload/web/app/scripts/models/Account.js index dc453ef3c..26241d8e3 100644 --- a/pyload/web/app/scripts/models/Account.js +++ b/pyload/web/app/scripts/models/Account.js @@ -28,6 +28,14 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt }, + // representation handled by server + toServerJSON: function() { + var data = this.toJSON(); + delete data.config; + + return data; + }, + parse: function(resp) { // Convert config to models resp.config = _.map(resp.config, function(item) { @@ -78,7 +86,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt }, destroy: function(options) { - options = App.apiRequest('removeAccount', {account: this.toJSON()}, options); + options = App.apiRequest('removeAccount', {account: this.toServerJSON()}, options); var self = this; options.success = function() { self.trigger('destroy', self, self.collection, options); -- cgit v1.2.3