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

View File

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