summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/app/services/persistence.coffee10
-rw-r--r--js/public/app.js10
-rw-r--r--js/tests/services/persistenceSpec.coffee10
3 files changed, 18 insertions, 12 deletions
diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee
index 24b371b54..41aa13722 100644
--- a/js/app/services/persistence.coffee
+++ b/js/app/services/persistence.coffee
@@ -81,25 +81,27 @@ angular.module('News').factory '_Persistence', ->
@_request.get 'news_items_starred', params
- starItem: (itemId) ->
+ starItem: (feedId, guidHash) ->
###
Stars an item
###
params =
routeParams:
- itemId: itemId
+ feedId: feedId
+ guidHash: guidHash
@_request.post 'news_items_star', params
- unstarItem: (itemId) ->
+ unstarItem: (feedId, guidHash) ->
###
Unstars an item
###
params =
routeParams:
- itemId: itemId
+ feedId: feedId
+ guidHash: guidHash
@_request.post 'news_items_unstar', params
diff --git a/js/public/app.js b/js/public/app.js
index e5b6e3cab..06cbb6e3e 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -1122,7 +1122,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
return this._request.get('news_items_starred', params);
};
- Persistence.prototype.starItem = function(itemId) {
+ Persistence.prototype.starItem = function(feedId, guidHash) {
/*
Stars an item
*/
@@ -1130,13 +1130,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var params;
params = {
routeParams: {
- itemId: itemId
+ feedId: feedId,
+ guidHash: guidHash
}
};
return this._request.post('news_items_star', params);
};
- Persistence.prototype.unstarItem = function(itemId) {
+ Persistence.prototype.unstarItem = function(feedId, guidHash) {
/*
Unstars an item
*/
@@ -1144,7 +1145,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var params;
params = {
routeParams: {
- itemId: itemId
+ feedId: feedId,
+ guidHash: guidHash
}
};
return this._request.post('news_items_unstar', params);
diff --git a/js/tests/services/persistenceSpec.coffee b/js/tests/services/persistenceSpec.coffee
index 091fcd60c..dc36661a4 100644
--- a/js/tests/services/persistenceSpec.coffee
+++ b/js/tests/services/persistenceSpec.coffee
@@ -101,10 +101,11 @@ describe '_Persistence', ->
it 'send a correct star item request', =>
params =
routeParams:
- itemId: 2
+ feedId: 2
+ guidHash: 'dfdfdf'
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
- pers.starItem(params.routeParams.itemId)
+ pers.starItem(params.routeParams.feedId, params.routeParams.guidHash)
expect(@req.post).toHaveBeenCalledWith('news_items_star', params)
@@ -112,10 +113,11 @@ describe '_Persistence', ->
it 'send a correct unstar item request', =>
params =
routeParams:
- itemId: 2
+ feedId: 2
+ guidHash: 'dfdfdf'
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
- pers.unstarItem(params.routeParams.itemId)
+ pers.unstarItem(params.routeParams.feedId, params.routeParams.guidHash)
expect(@req.post).toHaveBeenCalledWith('news_items_unstar', params)