1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-03 01:18:43 +02:00
unleash.unleash/frontend/src/data/archive-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

23 lines
492 B
JavaScript

import { throwIfNotSuccess, headers } from './helper';
const URI = 'api/admin/archive';
function fetchAll() {
return fetch(`${URI}/features`, { credentials: 'include' })
.then(throwIfNotSuccess)
.then(response => response.json());
}
function revive(featureName) {
return fetch(`${URI}/revive/${featureName}`, {
method: 'POST',
headers,
credentials: 'include',
}).then(throwIfNotSuccess);
}
export default {
fetchAll,
revive,
};