1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

fix rename with new route

This commit is contained in:
sveisvei 2016-12-09 14:38:32 +01:00
parent 946f9af733
commit da5381fdf9
2 changed files with 8 additions and 6 deletions

View File

@ -8,15 +8,18 @@ class ArchiveList extends Component {
render () {
const { archive, revive } = this.props;
archive.forEach(e => {
e.reviveName = e.name;
});
return (
<div>
<h6>Toggle Archive</h6>
<DataTable
rows={archive}
style={{ width: '100%' }}>
<TableHeader style={{ width: '25px' }} name="strategies" cellFormatter={(name) => (
<IconButton colored name="undo" onClick={() => revive(name)} />
<TableHeader style={{ width: '25px' }} name="reviveName" cellFormatter={(reviveName) => (
<IconButton colored name="undo" onClick={() => revive(reviveName)} />
)}>Revive</TableHeader>
<TableHeader style={{ width: '25px' }} name="enabled" cellFormatter={(v) => (v ? 'Yes' : '-')}>Enabled</TableHeader>
<TableHeader name="name">Toggle name</TableHeader>

View File

@ -8,11 +8,10 @@ function fetchAll () {
.then(response => response.json());
}
function revive (feature) {
return fetch(`${URI}/revive`, {
function revive (featureName) {
return fetch(`${URI}/revive/${featureName}`, {
method: 'POST',
headers,
body: JSON.stringify(feature),
credentials: 'include',
}).then(throwIfNotSuccess);
}