Skip to content

Commit 5cf4040

Browse files
authored
Merge pull request #1828 from IFRCGo/fix/surge-map-query
Update ERU query to only include active deployments
2 parents 2e38e61 + 6da49fa commit 5cf4040

File tree

1 file changed

+3
-1
lines changed
  • app/src/views/ActiveSurgeDeployments/SurgeMap

1 file changed

+3
-1
lines changed

app/src/views/ActiveSurgeDeployments/SurgeMap/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
} from '@ifrc-go/ui';
1515
import { useTranslation } from '@ifrc-go/ui/hooks';
1616
import {
17+
encodeDate,
1718
numericIdSelector,
1819
stringNameSelector,
1920
sumSafe,
@@ -63,7 +64,7 @@ const sourceOptions: mapboxgl.GeoJSONSourceRaw = {
6364
const SURGE_MECHANISM_ERU = 1;
6465
const SURGE_MECHANISM_RR = 2;
6566

66-
const now = new Date().toISOString();
67+
const now = encodeDate(new Date());
6768

6869
interface ClickedPoint {
6970
properties: AdminZeroFeatureProperties;
@@ -102,6 +103,7 @@ function SurgeMap(props: Props) {
102103
} = useRequest({
103104
url: '/api/v2/eru/',
104105
query: {
106+
end_date__gt: now,
105107
deployed_to__isnull: false,
106108
disaster_type: disasterFilter,
107109
limit: MAX_PAGE_LIMIT,

0 commit comments

Comments
 (0)