Skip to content

Commit

Permalink
chore: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Jan 18, 2024
1 parent 0f952b3 commit 2cd5473
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core_modules/capture-core/rules/postProcessRulesEffects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { effectActions } from '@dhis2/rules-engine-javascript';
import type { OutputEffect, HideOutputEffect, AssignOutputEffect, OutputEffects } from '@dhis2/rules-engine-javascript';
import { type RenderFoundation, dataElementTypes } from '../metaData';

const isValidOptionSet = (optionSets, effectValue) => {
if (!optionSets.options || effectValue === null || effectValue === '') {
const isValidOptionSet = (optionSet, effectValue) => {
if (!optionSet.options || effectValue === null || effectValue === '') {
return false;
}
// Using == because effect.value is always a string whereas option.value can be a number
if (optionSets.dataElementType === dataElementTypes.MULTI_TEXT) {
return effectValue.split(',').every(value => optionSets.options.some(option => option.value == value));
if (optionSet.dataElementType === dataElementTypes.MULTI_TEXT) {
return effectValue.split(',').every(value => optionSet.options.some(option => option.value == value));
}
return optionSets.options.some(option => option.value == effectValue);
return optionSet.options.some(option => option.value == effectValue);
};

const getAssignEffectsBasedOnHideField = (hideEffects: Array<HideOutputEffect>) =>
Expand Down

0 comments on commit 2cd5473

Please sign in to comment.