Skip to content

Commit

Permalink
fix: warn the user if data set or data element cc has no cocs #4
Browse files Browse the repository at this point in the history
  • Loading branch information
plinnegan committed Nov 3, 2021
1 parent 3c57d52 commit 3178d9f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/calculateInds.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ function getBaseFilter(piUid, allPis) {

function getFilters(metaItem, coMaps) {
const rawCocs = metaItem.categoryCombo.categoryOptionCombos
if (rawCocs.length === 0) {
throw new MappingGenerationError(
'Data set or data element does not appear to have any category option combos associated ' +
`with the assigned category combo: ${metaItem.categoryCombo}, please generate category ` +
'option combos in the admin app before attempting to generate the mapping again'
)
}
const cocs = rawCocs.map((coc) => orderCos(coc))
const result = []
for (const coc of cocs) {
Expand Down

0 comments on commit 3178d9f

Please sign in to comment.