From 509ca4ec6cd492dae93b70a1ba2eba3f8790e294 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Thu, 16 Jan 2025 12:42:07 -0300 Subject: [PATCH] feat(gadm): add source provider and source version to v2/area endpoint --- services/areas.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/areas.js b/services/areas.js index 576120f460..901368b34d 100644 --- a/services/areas.js +++ b/services/areas.js @@ -2,10 +2,11 @@ import { apiAuthRequest } from 'utils/request'; import { trackEvent } from 'utils/analytics'; const REQUEST_URL = '/v2/area'; +const SOURCE = `?source[provider]=gadm&source[version]=4.1`; export const getArea = (id, userToken = null) => apiAuthRequest - .get(`${REQUEST_URL}/${id}`, { + .get(`${REQUEST_URL}/${id}${SOURCE}`, { headers: { ...(userToken && { Authorization: `Bearer ${userToken}`, @@ -36,7 +37,7 @@ export const getArea = (id, userToken = null) => }); export const getAreas = () => - apiAuthRequest.get(REQUEST_URL).then((areasResponse) => { + apiAuthRequest.get(`${REQUEST_URL}${SOURCE}`).then((areasResponse) => { const { data: areas } = areasResponse.data; return areas.map((area) => {