From 39633169a94e16d36f923df477721a45b552316d Mon Sep 17 00:00:00 2001 From: mozafar Date: Fri, 3 Nov 2023 16:11:52 +0000 Subject: [PATCH] chore: migrate to new tracker API --- src/pages/EventExport/form-helper.js | 2 +- src/pages/TEIExport/form-helper.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/EventExport/form-helper.js b/src/pages/EventExport/form-helper.js index bdecb8ff4..37d5aaf6a 100644 --- a/src/pages/EventExport/form-helper.js +++ b/src/pages/EventExport/form-helper.js @@ -24,7 +24,7 @@ const onExport = (baseUrl, setExportEnabled) => (values) => { } = values // generate URL and redirect - const apiBaseUrl = `${baseUrl}/api/` + const apiBaseUrl = `${baseUrl}/api/tracker/` const endpoint = `events` const endpointExtension = compression ? `${format}.${compression}` : format const filename = `${endpoint}.${endpointExtension}` diff --git a/src/pages/TEIExport/form-helper.js b/src/pages/TEIExport/form-helper.js index 5f19cb647..ad8be9be1 100644 --- a/src/pages/TEIExport/form-helper.js +++ b/src/pages/TEIExport/form-helper.js @@ -51,7 +51,7 @@ const valuesToParams = ( // include selected org.units only when manual selection is selected // ouMode is then stored in the `inclusion` field if (ouMode === OU_MODE_MANUAL_VALUE) { - minParams.ou = selectedOrgUnits.map((o) => pathToId(o)).join(';') + minParams.orgUnit = selectedOrgUnits.map((o) => pathToId(o)).join(';') minParams.ouMode = inclusion } @@ -111,8 +111,8 @@ const onExport = (baseUrl, setExportEnabled) => async (values) => { const { format } = values // generate URL and redirect - const apiBaseUrl = `${baseUrl}/api/` - const endpoint = `trackedEntityInstances` + const apiBaseUrl = `${baseUrl}/api/tracker/` + const endpoint = `trackedEntities` const filename = `${endpoint}.${format}` const downloadUrlParams = valuesToParams(values, filename) const url = `${apiBaseUrl}${endpoint}.${format}?${downloadUrlParams}`