From 7c6d727f6a95f77d76e9674ba4ed8e5dc9906bee Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sun, 6 Apr 2014 16:00:21 +0200 Subject: fix errors related to persistence data change --- js/public/app.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'js/public/app.js') diff --git a/js/public/app.js b/js/public/app.js index 1b393b81f..396626e47 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -1281,7 +1281,7 @@ License along with this library. If not, see . }; FeedBusinessLayer.prototype.create = function(url, parentId, onSuccess, onFailure) { - var feed, success; + var failure, feed, success; if (parentId == null) { parentId = 0; } @@ -1313,14 +1313,13 @@ License along with this library. If not, see . }; this._feedModel.add(feed); success = function(response) { - if (response.status === 'error') { - feed.error = response.msg; - return onFailure(); - } else { - return onSuccess(response.data); - } + return onSuccess(response); + }; + failure = function(response) { + feed.error = response.msg; + return onFailure(); }; - return this._persistence.createFeed(url, parentId, success); + return this._persistence.createFeed(url, parentId, success, failure); }; FeedBusinessLayer.prototype.markErrorRead = function(url) { @@ -1494,7 +1493,7 @@ License along with this library. If not, see . }; FolderBusinessLayer.prototype.create = function(folderName, onSuccess, onFailure) { - var folder, success; + var failure, folder, success; if (onSuccess == null) { onSuccess = null; } @@ -1516,14 +1515,13 @@ License along with this library. If not, see . }; this._folderModel.add(folder); success = function(response) { - if (response.status === 'error') { - folder.error = response.msg; - return onFailure(); - } else { - return onSuccess(response.data); - } + return onSuccess(response); + }; + failure = function(response) { + folder.error = response.msg; + return onFailure(); }; - return this._persistence.createFolder(folderName, 0, success); + return this._persistence.createFolder(folderName, 0, success, failure); }; FolderBusinessLayer.prototype.markErrorRead = function(folderName) { -- cgit v1.2.3