1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-22 11:18:20 +02:00
unleash.unleash/frontend/src/data/history-api.js
Simen Bekkhus 683ae7e6d8 Use prettier (#87)
* Use prettier

* Upgrade to 1.6 beta

* Update lint deps

* Upgrade to full 1.6
2017-08-28 19:15:47 +02:00

21 lines
487 B
JavaScript

import { throwIfNotSuccess } from './helper';
const URI = 'api/admin/events';
function fetchAll() {
return fetch(URI, { credentials: 'include' })
.then(throwIfNotSuccess)
.then(response => response.json());
}
function fetchHistoryForToggle(toggleName) {
return fetch(`${URI}/${toggleName}`, { credentials: 'include' })
.then(throwIfNotSuccess)
.then(response => response.json());
}
export default {
fetchAll,
fetchHistoryForToggle,
};