diff --git a/src/upload/Dashboard.js b/src/upload/Dashboard.js index ac8449000..d42caf035 100644 --- a/src/upload/Dashboard.js +++ b/src/upload/Dashboard.js @@ -68,7 +68,11 @@ const Dashboard = ({ getStatuses, getUploadTypes, uploadTypes = new UploadTypes( } else if ( !_.isUndefined((uploadType = uploadTypes.getCode(entityForDownload) || staticTypesWithDynamicDownload.getCode(entityForDownload))) ) { - await api.downloadDynamicSample(uploadType); + if (uploadType === "locations") { + await api.downloadLocationsSample(uploadType, mode, hierarchy); + } else { + await api.downloadDynamicSample(uploadType); + } } }; diff --git a/src/upload/api.js b/src/upload/api.js index fe9975786..760680283 100644 --- a/src/upload/api.js +++ b/src/upload/api.js @@ -26,5 +26,11 @@ export default { const content = await file.text(); files.download(`sample-${type}.csv`, content); }, - downloadDynamicSample: type => http.downloadFile(`/web/importSample?uploadType=${type}`, `sample-${type}.csv`) + downloadDynamicSample: type => http.downloadFile(`/web/importSample?uploadType=${type}`, `sample-${type}.csv`), + downloadLocationsSample: (type, locationUploadMode, locationHierarchy) => { + return http.downloadFile( + `/web/importSample?uploadType=${type}&locationUploadMode=${locationUploadMode}&locationHierarchy=${locationHierarchy}`, + `sample-${type}.csv` + ); + } };