1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-07 01:16:28 +02:00
unleash.unleash/packages/unleash-frontend-next/src/data/archive-api.js
2016-11-04 22:14:58 +01:00

25 lines
449 B
JavaScript

import { throwIfNotSuccess, headers } from './helper';
const URI = '/archive';
function fetchAll () {
return fetch(`${URI}/features`)
.then(throwIfNotSuccess)
.then(response => response.json());
}
function revive (feature) {
return fetch(`${URI}/revive`, {
method: 'POST',
headers,
body: JSON.stringify(feature),
}).then(throwIfNotSuccess);
}
module.exports = {
fetchAll,
revive,
};