Skip to content

Commit

Permalink
fix: property optionSet was always defined before doing the refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
superskip committed Nov 24, 2023
1 parent b5ee351 commit 30b53e6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ export const useProgramMetadata = (programId: string) => {
programStageDataElements: stage.programStageDataElements
.map((programStageDataElement) => {
const dataElement = dataElementDictionary[programStageDataElement.dataElementId];
const optionSet = dataElement.optionSetValue ? optionSetDictionary[dataElement.optionSet.id] : {};
return {
displayInReports: programStageDataElement.displayInReports,
dataElement: {
id: dataElement.id,
valueType: dataElement.valueType,
displayName: dataElement.displayName,
displayFormName: dataElement.displayFormName,
...optionSet,
optionSet: dataElement.optionSetValue ? optionSetDictionary[dataElement.optionSet.id] : {},
},
};
}),
Expand Down

0 comments on commit 30b53e6

Please sign in to comment.