UI: Use only string from api/island/mode

This commit is contained in:
Ilija Lazoroski 2022-08-01 18:51:00 +02:00
parent 86242a021d
commit cf084242f0
3 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ class AppComponent extends AuthComponent {
setMode = () => {
return IslandHttpClient.get('/api/island/mode')
.then(res => {
this.setState({islandMode: res.body.mode});
this.setState({islandMode: res.body});
});
}

View File

@ -74,7 +74,7 @@ const LandingPageComponent = (props: Props) => {
}
function setScenario(scenario: string) {
IslandHttpClient.put('/api/island/mode', {'mode': scenario})
IslandHttpClient.put('/api/island/mode', scenario)
.then(() => {
props.onStatusChange();
});

View File

@ -111,9 +111,9 @@ const IslandResetModal = (props: Props) => {
if (res.ok) {
return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'PUT', body:'[]'})
}})
.then(res => {
.then(res => {
if (res.ok) {
return auth.authFetch('/api/island/mode', {method: 'PUT', body: '{"mode": "unset"}'})
return auth.authFetch('/api/island/mode', {method: 'PUT', body: '"unset"'})
}})
.then(res => {
if (!res.ok) {