Skip to content

Commit

Permalink
fix: include attribute options in completion post [DHIS2-15032] (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Apr 5, 2023
1 parent 293d33f commit 8df1dc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/shared/completion/use-set-form-completion-mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ const MUTATION_SET_FORM_COMPLETION = {
pe: periodId,
ou: orgUnitId,
cc: categoryComboId,
co: categoryOptionIds,
cp: categoryOptionIds,
completed,
}) => {
return {
dataSet: dataSetId,
period: periodId,
orgUnit: orgUnitId,
attribute: { combo: categoryComboId, options: categoryOptionIds },
attribute: {
combo: categoryComboId,
options: categoryOptionIds?.split(';'),
},
completed,
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/shared/use-data-value-set/query-key-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export const dataValueSets = {
periodId,
orgUnitId,
categoryComboId,
categoryOptionIds = [],
categoryOptionIds,
}) => {
const params = {
ds: dataSetId,
pe: periodId,
ou: orgUnitId,
cc: categoryComboId,
cp: categoryOptionIds.join(';'),
cp: categoryOptionIds && categoryOptionIds.join(';'),
}

return [...dataValueSets.all, { params }]
Expand Down

1 comment on commit 8df1dc0

@dhis2-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.