forked from p15670423/monkey
UI: Use new `/api/clear-simulation-data` endpoint
This commit is contained in:
parent
9ece3c100b
commit
e8f76f39e1
|
@ -54,8 +54,7 @@ const IslandResetModal = (props: Props) => {
|
||||||
<button type='button' className='btn btn-danger btn-lg' style={{margin: '5px'}}
|
<button type='button' className='btn btn-danger btn-lg' style={{margin: '5px'}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDeleteStatus(Loading);
|
setDeleteStatus(Loading);
|
||||||
resetIsland('/api?action=delete-agent-data',
|
clearSimulationData(() => {
|
||||||
() => {
|
|
||||||
setDeleteStatus(Done)
|
setDeleteStatus(Done)
|
||||||
})
|
})
|
||||||
}}>
|
}}>
|
||||||
|
@ -91,11 +90,10 @@ const IslandResetModal = (props: Props) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetIsland(url: string, callback: () => void) {
|
function clearSimulationData(callback: () => void) {
|
||||||
auth.authFetch(url)
|
auth.authFetch('/api/clear-simulation-data', {method: 'POST'})
|
||||||
.then(res => res.json())
|
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res['status'] === 'OK') {
|
if (res.status === 200) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue