From 97e0cc738878a1b2c6dcd60be8ca31831c236f25 Mon Sep 17 00:00:00 2001 From: Fatimah Zulfiqar Date: Wed, 11 Dec 2024 11:06:04 +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..d49b4a76 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, + 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)} allowAdditions={allowAdditions} width={width} />