Won't Fix
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee
Unassigned
UnassignedReporter
Mateusz Kwiatkowski
Mateusz KwiatkowskiLabels
Components
Priority
Time Assistant
Time Assistant
Created March 26, 2018 at 11:57 AM
Updated February 8, 2023 at 1:29 PM
Resolved March 27, 2018 at 8:49 AM
Steps to reproduce
1. Log in as administrator
2. Go to Administration -> Facilities
3. Type "bal" in name filter and click Search, should be 2 results
4. Select "Malawi" Geographic Zone and click Search
5. The result didn't change despite both facilities have Balaka as their Geographic Zone
Root Cause
It appears that /api/facilities/search endpoint is "merging" results from those 2 filters instead of returning the intersection of those two. If you select a Geographic Zone that has some facilities the result will have more items. It seems that this endpoint is using ORs instead of ANDs in query. This was probably changed for /api/requisitionsForConvert endpoint that is using /api/facilities/search. Convert to Order screen has single search filter that is searching by facility Name and Code, which requires /api/facilities/search to use ORs, otherwise it would be always returning empty result.
Solution
change /api/facilities/search query to use ANDs instead of ORs
this should be done together with OLMIS-4373, otherwise filtering on Convert to Order screen will stop working