Skip to content

Commit f70ce83

Browse files
authored
Merge pull request #1173 from IFRCGo/fix/all-appealslist-region-filter
Fix All Appeals region filter
2 parents a24dd3f + 3508c83 commit f70ce83

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.changeset/bright-seals-greet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
Add missing validations in DREF forms

.changeset/few-laws-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
Fix region filter in All Appeals table

.changeset/quiet-comics-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
Handle countries with no bounding box

app/src/views/AllAppeals/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export function Component() {
109109
},
110110
(dtype) => dtype,
111111
);
112+
112113
const [filterRegion, setFilterRegion] = useUrlSearchState<RegionListItem['name'] | undefined>(
113114
'region',
114115
(searchValue) => {
@@ -122,7 +123,6 @@ export function Component() {
122123
) {
123124
return potentialValue;
124125
}
125-
126126
return undefined;
127127
},
128128
(regionId) => regionId,
@@ -143,8 +143,8 @@ export function Component() {
143143
ordering,
144144
atype: filterAppealType,
145145
dtype: filterDisasterType,
146-
country: filterCountry ? [filterCountry] : undefined,
147-
region: filterRegion ? [filterRegion] : undefined,
146+
country: isDefined(filterCountry) ? [filterCountry] : undefined,
147+
region: isDefined(filterRegion) ? [filterRegion] : undefined,
148148
start_date__gte: filter.startDateAfter,
149149
start_date__lte: filter.startDateBefore,
150150
}),

0 commit comments

Comments
 (0)