Skip to content

Commit

Permalink
fix: filter data elements and tracked entity attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimSM committed Oct 12, 2023
1 parent 8dc1e4d commit 980f9b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const convert = (() => {

const getProgramStageDataElements = programStageDataElements =>
(programStageDataElements || [])
.filter(programStageDataElement => programStageDataElement.dataElement)
.filter(programStageDataElement => programStageDataElement.dataElement?.id)
.map((programStageDataElement) => {
programStageDataElement.dataElement.translations =
// $FlowFixMe[incompatible-type] automated comment
Expand All @@ -58,6 +58,7 @@ const convert = (() => {

const getProgramTrackedEntityAttributes = programAttributes =>
(programAttributes || [])
.filter(({ trackedEntityAttribute }) => trackedEntityAttribute?.id)
.map(pa => getProgramTrackedEntityAttribute(pa));

return (response: apiProgramsResponse) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const convert = (() => {

const getTrackedEntityTypeAttributes = trackedEntityTypeAttributes =>
(trackedEntityTypeAttributes || [])
.filter(({ trackedEntityAttribute }) => trackedEntityAttribute?.id)
.map(trackedEntityTypeAttribute => getTrackedEntityTypeAttribute(trackedEntityTypeAttribute));

return response =>
Expand Down

0 comments on commit 980f9b3

Please sign in to comment.