1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/packages/unleash-frontend/public/js/stores/EventStore.js

26 lines
447 B
JavaScript
Raw Normal View History

2016-06-18 21:53:18 +02:00
'use strict';
const reqwest = require('reqwest');
2014-11-13 15:14:41 +01:00
2016-06-18 21:53:18 +02:00
const TYPE = 'json';
2014-11-13 15:14:41 +01:00
2016-06-18 21:53:18 +02:00
const EventStore = {
2016-07-02 11:54:50 +02:00
getEvents () {
2014-11-13 15:14:41 +01:00
return reqwest({
url: 'events',
method: 'get',
2016-06-18 21:55:46 +02:00
type: TYPE,
2014-11-13 15:14:41 +01:00
});
2014-11-17 11:15:10 +01:00
},
getEventsByName (eventName) {
2014-11-17 11:15:10 +01:00
return reqwest({
url: `events/${eventName}`,
2014-11-17 11:15:10 +01:00
method: 'get',
2016-06-18 21:55:46 +02:00
type: TYPE,
2014-11-17 11:15:10 +01:00
});
2016-06-18 21:55:46 +02:00
},
2014-11-17 11:15:10 +01:00
2014-11-13 15:14:41 +01:00
};
module.exports = EventStore;