diff options
Diffstat (limited to 'js/service/ItemResource.js')
-rw-r--r-- | js/service/ItemResource.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/js/service/ItemResource.js b/js/service/ItemResource.js index 779355e0a..dc74f637a 100644 --- a/js/service/ItemResource.js +++ b/js/service/ItemResource.js @@ -79,12 +79,6 @@ app.factory('ItemResource', (Resource, $http, BASE_URL) => { } - keepUnread (itemId) { - this.get(itemId).keepUnread = true; - return this.read(itemId, false); - } - - readFeed (feedId, read=true) { for (let item of this.values.filter(i => i.feedId === feedId)) { item.unread = !read; @@ -93,6 +87,20 @@ app.factory('ItemResource', (Resource, $http, BASE_URL) => { } + readAll () { + for (let item of this.values) { + item.unread = false; + } + return this.http.post(`${this.BASE_URL}/items/read`); + } + + + keepUnread (itemId) { + this.get(itemId).keepUnread = true; + return this.read(itemId, false); + } + + } return new ItemResource($http, BASE_URL); |