Skip to content
Snippets Groups Projects
Commit aa04667c authored by Joni Laukka's avatar Joni Laukka
Browse files

Edit form closes when submitted

parent 158328ec
No related branches found
No related tags found
2 merge requests!26Development,!24Faction color edit form
......@@ -258,12 +258,16 @@ export class EditGameForm extends React.Component {
},
body: JSON.stringify(gameObject)
})
.then(res => res.json())
.then(res => {
if (!res.ok) {
throw Error(res.statusMessage);
} else {
return res.json();
}
})
.then(result => {
alert(result.message);
if (result.code === 200) {
this.handleView();
}
this.handleView();
})
.catch(error => console.log("Error: ", error));
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment