fix: fix wrong org issue for user's "signupApplication"

This commit is contained in:
Yang Luo
2024-01-28 01:51:03 +08:00
parent 71bb400559
commit 104f975a2f

View File

@ -122,6 +122,17 @@ class UserEditPage extends React.Component {
this.setState({
applications: res.data || [],
});
const applications = res.data;
if (this.state.user) {
if (this.state.user.signupApplication === "" || applications.filter(application => application.name === this.state.user.signupApplication).length === 0) {
if (applications.length > 0) {
this.updateUserField("signupApplication", applications[0].name);
} else {
this.updateUserField("signupApplication", "");
}
}
}
});
}