diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2016-01-30 23:17:03 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-30 23:20:27 +0100 |
commit | 678af2747d6414379e81ee6856c7ec2f3cd5a890 (patch) | |
tree | c5d92a631e1d4d3a7f2880512a7555ccdd39b71a /src/web/js/actions | |
parent | wip redoing feed panel (diff) | |
download | newspipe-678af2747d6414379e81ee6856c7ec2f3cd5a890.tar.gz newspipe-678af2747d6414379e81ee6856c7ec2f3cd5a890.tar.bz2 newspipe-678af2747d6414379e81ee6856c7ec2f3cd5a890.zip |
registering modifications on feeds / categories
Diffstat (limited to 'src/web/js/actions')
-rw-r--r-- | src/web/js/actions/RightPanelActions.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/web/js/actions/RightPanelActions.js b/src/web/js/actions/RightPanelActions.js index c60bffcf..838690d1 100644 --- a/src/web/js/actions/RightPanelActions.js +++ b/src/web/js/actions/RightPanelActions.js @@ -1,6 +1,7 @@ +var jquery = require('jquery'); var JarrDispatcher = require('../dispatcher/JarrDispatcher'); var ActionTypes = require('../constants/JarrConstants'); -var jquery = require('jquery'); +var MenuActions = require('../actions/MenuActions'); var RightPanelActions = { loadArticle: function(article_id, was_read_before) { @@ -13,7 +14,19 @@ var RightPanelActions = { }); } ); - + }, + _apiReq: function(meth, id, obj_type, data, success_callback) { + var args = {type: meth, contentType: 'application/json', + url: "api/v2.0/" + obj_type + "/" + id} + if(data) {args.data = JSON.stringify(data);} + if(success_callback) {args.success = success_callback;} + jquery.ajax(args); + }, + putObj: function(id, obj_type, fields) { + this._apiReq('PUT', id, obj_type, fields, MenuActions.reload); + }, + delObj: function(id, obj_type, fields) { + this._apiReq('DELETE', id, obj_type, null, MenuActions.reload); }, }; |