From 6d2a9ce66fc1a27240ec4f313da92ad605775c2d Mon Sep 17 00:00:00 2001 From: Fatimah Zulfiqar Date: Wed, 11 Dec 2024 13:00:46 +0100 Subject: [PATCH] subjects: updated subject serialization --- .../widgets/custom_fields/SubjectAutocompleteDropdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/forms/widgets/custom_fields/SubjectAutocompleteDropdown.js b/src/lib/forms/widgets/custom_fields/SubjectAutocompleteDropdown.js index 8ca44708..d4c1d050 100644 --- a/src/lib/forms/widgets/custom_fields/SubjectAutocompleteDropdown.js +++ b/src/lib/forms/widgets/custom_fields/SubjectAutocompleteDropdown.js @@ -10,8 +10,8 @@ export class SubjectAutocompleteDropdown extends Component { const scheme = subject.scheme ? `(${subject.scheme}) ` : ""; return { text: scheme + subject.subject, - value: subject.subject, - key: subject.subject, + value: subject.id ?? subject.subject, + key: subject.id, ...(subject.id ? { id: subject.id } : {}), subject: subject.subject, }; @@ -84,7 +84,7 @@ export class SubjectAutocompleteDropdown extends Component { ); }} label={labelContent} - value={getIn(values, fieldPath, []).map((val) => val.subject)} + value={getIn(values, fieldPath, []).map((val) => val.id ?? val.subject)} allowAdditions={allowAdditions} width={width} />