mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Refactor out Setting.getArrayItem()
This commit is contained in:
@ -87,7 +87,8 @@ class AffiliationSelect extends React.Component {
|
||||
) : (
|
||||
<Select virtual={false} style={{width: '100%'}} value={this.props.user.affiliation} onChange={(value => {
|
||||
const name = value;
|
||||
const id = this.state.affiliationOptions.filter(affiliationOption => affiliationOption.name === name)[0].id;
|
||||
const affiliationOption = Setting.getArrayItem(this.state.affiliationOptions, "name", name);
|
||||
const id = affiliationOption.id;
|
||||
this.updateUserField('affiliation', name);
|
||||
this.updateUserField('score', id);
|
||||
})}>
|
||||
|
Reference in New Issue
Block a user