mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
fix: handle add message in frontend (#1340)
This commit is contained in:
@ -38,9 +38,12 @@ class ModelListPage extends BaseListPage {
|
||||
const newModel = this.newModel();
|
||||
ModelBackend.addModel(newModel)
|
||||
.then((res) => {
|
||||
this.props.history.push({pathname: `/models/${newModel.owner}/${newModel.name}`, mode: "add"});
|
||||
}
|
||||
)
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push({pathname: `/models/${newModel.owner}/${newModel.name}`, mode: "add"});
|
||||
} else {
|
||||
Setting.showMessage("error", `Model failed to add: ${res.msg}`);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
Setting.showMessage("error", `Model failed to add: ${error}`);
|
||||
});
|
||||
|
Reference in New Issue
Block a user