Skip to content

Commit

Permalink
fix: [TECH-1627] use only valid combinations of orgUnit and ouMode (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
superskip authored Nov 10, 2023
1 parent 2bf12a6 commit 20d05f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const loadSearchGroupDuplicatesForReviewEpic = (
payload: {
page,
pageSize,
orgUnitId,
selectedScopeId,
scopeType,
dataEntryId,
Expand All @@ -73,7 +72,6 @@ export const loadSearchGroupDuplicatesForReviewEpic = (

const contextParam = scopeType === scopeTypes.TRACKER_PROGRAM ? { program: selectedScopeId } : { trackedEntityType: selectedScopeId };
const queryArgs = {
ou: orgUnitId,
ouMode: 'ACCESSIBLE',
pageSize,
page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import { getSearchFormId } from '../getSearchFormId';
import type { QuerySingleResource } from '../../../utils/api/api.types';

const getOuQueryArgs = (orgUnit: ?Object, orgUnitScope: string) =>
(orgUnitScope !== 'ACCESSIBLE' ?
{ orgUnit: orgUnit && orgUnit.id, ouMode: orgUnitScope } :
{ ouMode: orgUnitScope });
(['ACCESSIBLE', 'CAPTURE', 'ALL'].includes(orgUnitScope) ?
{ ouMode: orgUnitScope } :
{ orgUnit: orgUnit && orgUnit.id, ouMode: orgUnitScope });

const getContextQueryArgs = (programId: ?string, trackedEntityTypeId: string) =>
(programId ? { program: programId } : { trackedEntityType: trackedEntityTypeId });
Expand Down

0 comments on commit 20d05f1

Please sign in to comment.