feat: refactor code to use responseOK everywhere (#2111)

* refactor: use responseOK return frontend format json data

* revert handle error

* revert handle error
This commit is contained in:
Yaodong Yu
2023-07-23 09:49:16 +08:00
committed by GitHub
parent fc9528be43
commit a6f803aff1
53 changed files with 178 additions and 218 deletions

View File

@ -48,7 +48,7 @@ class ModelEditPage extends React.Component {
getModel() {
ModelBackend.getModel(this.state.organizationName, this.state.modelName)
.then((res) => {
if (res === null) {
if (res.data === null) {
this.props.history.push("/404");
return;
}
@ -59,7 +59,7 @@ class ModelEditPage extends React.Component {
}
this.setState({
model: res,
model: res.data,
});
});
}
@ -68,7 +68,7 @@ class ModelEditPage extends React.Component {
OrganizationBackend.getOrganizations("admin")
.then((res) => {
this.setState({
organizations: (res.msg === undefined) ? res : [],
organizations: res.data || [],
});
});
}