Skip to content

Commit

Permalink
fix: return item label and DOID
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Nov 16, 2023
1 parent 0ac2a75 commit 0162c8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/data_submission/consent_group/EditConsentGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -240,7 +240,6 @@ export const EditConsentGroup = (props) => {
isMulti: true,
isCreatable: true,
isAsync: true,
optionsAreString: true,
loadOptions: searchOntologies,
id: idx + '_diseaseSpecificUseText',
name: 'diseaseSpecificUse',
Expand All @@ -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
});
},
Expand Down

0 comments on commit 0162c8a

Please sign in to comment.