Skip to content

Commit

Permalink
fix: fix reset attribute search fields (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
usamaidrsk authored Dec 11, 2024
1 parent f653e3f commit 03c7671
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const AdvancedPatientSearchComponent: React.FC<AdvancedPatientSearchProps> = ({
const patientAttributeValue = isValueObj
? (matchingAttribute.value as OpenmrsResource).uuid
: matchingAttribute.value;
if (patientAttributeValue !== value) {
if ((patientAttributeValue as string).toLowerCase() !== value.toLowerCase()) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const RefineSearch: React.FC<RefineSearchProps> = ({ setFilters, inTabletOrOverl
(data: AdvancedPatientSearchState) => {
const cleanedAttributes = Object.entries(data.attributes || {}).reduce(
(acc, [key, value]) => {
if (value !== '') {
if (value) {
acc[key] = value;
}
return acc;
Expand All @@ -71,7 +71,7 @@ const RefineSearch: React.FC<RefineSearchProps> = ({ setFilters, inTabletOrOverl
[setFilters],
);
const handleResetFields = useCallback(() => {
reset();
reset({ ...initialFilters, attributes: {} });
setFilters(initialFilters);
setShowRefineSearchDialog(false);
}, [reset, setFilters]);
Expand Down

0 comments on commit 03c7671

Please sign in to comment.