From 0162c8a0a65aafb98b4622a353e3b8b89a7e4f65 Mon Sep 17 00:00:00 2001 From: Florian Boulnois Date: Thu, 16 Nov 2023 17:08:05 -0500 Subject: [PATCH] fix: return item label and DOID --- .../data_submission/consent_group/EditConsentGroup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/data_submission/consent_group/EditConsentGroup.js b/src/pages/data_submission/consent_group/EditConsentGroup.js index 1923d97c42..c89385fc50 100644 --- a/src/pages/data_submission/consent_group/EditConsentGroup.js +++ b/src/pages/data_submission/consent_group/EditConsentGroup.js @@ -26,7 +26,7 @@ const searchOntologies = (query, callback) => { DAR.getAutoCompleteOT(query).then( items => { options = items.map(function (item) { - return item.label; + return { displayText: item.label, id: item.id }; }); callback(options); }); @@ -240,7 +240,6 @@ export const EditConsentGroup = (props) => { isMulti: true, isCreatable: true, isAsync: true, - optionsAreString: true, loadOptions: searchOntologies, id: idx + '_diseaseSpecificUseText', name: 'diseaseSpecificUse', @@ -253,10 +252,11 @@ export const EditConsentGroup = (props) => { onValidationChange({ key: 'diseaseSpecificUse', validation }); }, onChange: ({ key, value, isValid }) => { - setSelectedDiseases(value); + const doids = value.map((v) => v.id); + setSelectedDiseases(doids); onChange({ key: key, - value: value, + value: doids, isValid: isValid }); },