Skip to content

Commit

Permalink
affiliations: fix serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova committed Nov 15, 2023
1 parent 5b1bf1c commit 356e726
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export class AffiliationsField extends Component {
text: affiliation.acronym
? `${affiliation.name} (${affiliation.acronym})`
: affiliation.name,
value: affiliation.id,
value: affiliation.id || affiliation.name,
key: affiliation.id,
id: affiliation.id,
name: affiliation.name,
}));

render() {
Expand Down Expand Up @@ -57,7 +58,9 @@ export class AffiliationsField extends Component {
selectedSuggestions
);
}}
value={getIn(values, fieldPath, []).map((val) => val.id)}
value={getIn(values, fieldPath, []).map(
(val) => val.id || val.text || val.name
)}
ref={selectRef}
// Disable UI-side filtering of search results
search={(options) => options}
Expand Down

0 comments on commit 356e726

Please sign in to comment.