mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 22:20:01 +08:00
feat: replace all panic by response err (#1993)
* fix: missing return after response error * feat: handle error in frontend * feat: disable loading and catch org edit error * chore: i18 for error message * chore: remove break line * feat: application catching error
This commit is contained in:
@ -121,13 +121,17 @@ class UserEditPage extends React.Component {
|
||||
|
||||
getUserApplication() {
|
||||
ApplicationBackend.getUserApplication(this.state.organizationName, this.state.userName)
|
||||
.then((application) => {
|
||||
.then((res) => {
|
||||
if (res.status === "error") {
|
||||
Setting.showMessage("error", res.msg);
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
application: application,
|
||||
application: res,
|
||||
});
|
||||
|
||||
this.setState({
|
||||
isGroupsVisible: application.organizationObj.accountItems?.some((item) => item.name === "Groups" && item.visible),
|
||||
isGroupsVisible: res.organizationObj.accountItems?.some((item) => item.name === "Groups" && item.visible),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user