Skip to content

Commit c16f28d

Browse files
0einstein0slint
authored andcommitted
subjects: updated subject serialization
1 parent 39cc7b5 commit c16f28d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/forms/widgets/custom_fields/SubjectAutocompleteDropdown.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export class SubjectAutocompleteDropdown extends Component {
1010
const scheme = subject.scheme ? `(${subject.scheme}) ` : "";
1111
return {
1212
text: scheme + subject.subject,
13-
value: subject.subject,
14-
key: subject.subject,
13+
value: subject.id ?? subject.subject,
14+
key: subject.id,
1515
...(subject.id ? { id: subject.id } : {}),
1616
subject: subject.subject,
1717
};
@@ -84,7 +84,7 @@ export class SubjectAutocompleteDropdown extends Component {
8484
);
8585
}}
8686
label={labelContent}
87-
value={getIn(values, fieldPath, []).map((val) => val.subject)}
87+
value={getIn(values, fieldPath, []).map((val) => val.id ?? val.subject)}
8888
allowAdditions={allowAdditions}
8989
width={width}
9090
/>

0 commit comments

Comments
 (0)