From ac4a736b2346705723520c2bf1460483f2e97e57 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Mon, 6 May 2024 16:01:39 +0200 Subject: [PATCH] fix(orgunit-selector): filter using query instead of displayName --- src/forms/form-fields/orgunit-tree-multi-select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forms/form-fields/orgunit-tree-multi-select.js b/src/forms/form-fields/orgunit-tree-multi-select.js index 61264f817..1664c7884 100644 --- a/src/forms/form-fields/orgunit-tree-multi-select.js +++ b/src/forms/form-fields/orgunit-tree-multi-select.js @@ -115,13 +115,13 @@ export default class OrganisationUnitTreeMultiSelect extends Component { return Observable.of(this.state.originalRoots); } const organisationUnitRequest = this.context.d2.models.organisationUnits - .filter().on('displayName').ilike(searchValue) // withinUserHierarchy makes the query only apply to the subtrees of the organisation units that are // assigned to the current user .list({ pageSize: 100, fields: 'id,displayName,path,children::isNotEmpty', withinUserHierarchy: true, + query: searchValue, }) .then(modelCollection => modelCollection.toArray());