summaryrefslogtreecommitdiffstats
path: root/js/public/app.js
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-06 16:00:21 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-06 16:00:21 +0200
commit7c6d727f6a95f77d76e9674ba4ed8e5dc9906bee (patch)
treeda7cef78b06520e7370bf52a69afbc38d2975f40 /js/public/app.js
parentdbd18a20993221baf9e851fbd8eba1a48c411b3d (diff)
fix errors related to persistence data change
Diffstat (limited to 'js/public/app.js')
-rw-r--r--js/public/app.js30
1 files changed, 14 insertions, 16 deletions
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 <http://www.gnu.org/licenses/>.
};
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 <http://www.gnu.org/licenses/>.
};
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 <http://www.gnu.org/licenses/>.
};
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 <http://www.gnu.org/licenses/>.
};
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) {