feat: show 404 error for non-existent objects in edit pages

This commit is contained in:
Jiawei Chen
2023-06-09 21:52:30 +08:00
committed by Yang Luo
parent 05703720c5
commit 0bda29f143
19 changed files with 95 additions and 0 deletions

View File

@ -66,6 +66,11 @@ class UserEditPage extends React.Component {
getUser() {
UserBackend.getUser(this.state.organizationName, this.state.userName)
.then((data) => {
if (data === null) {
this.props.history.push("/404");
return;
}
if (data.status === null || data.status !== "error") {
this.setState({
user: data,