2014-11-01 14:52:37 +01:00
|
|
|
var reqwest = require('reqwest');
|
|
|
|
|
2014-11-25 15:28:08 +01:00
|
|
|
var TYPE = 'json';
|
|
|
|
var CONTENT_TYPE = 'application/json';
|
2014-11-01 14:52:37 +01:00
|
|
|
|
|
|
|
var StrategyStore = {
|
|
|
|
createStrategy: function (strategy) {
|
|
|
|
return reqwest({
|
|
|
|
url: 'strategies',
|
|
|
|
method: 'post',
|
|
|
|
type: TYPE,
|
|
|
|
contentType: CONTENT_TYPE,
|
|
|
|
data: JSON.stringify(strategy)
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2014-12-09 09:22:54 +01:00
|
|
|
removeStrategy: function (strategy) {
|
|
|
|
return reqwest({
|
|
|
|
url: 'strategies/'+strategy.name,
|
|
|
|
method: 'delete',
|
|
|
|
type: TYPE
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2014-11-01 14:52:37 +01:00
|
|
|
getStrategies: function () {
|
|
|
|
return reqwest({
|
|
|
|
url: 'strategies',
|
|
|
|
method: 'get',
|
|
|
|
type: TYPE
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = StrategyStore;
|