From 68df200e020f20e6c2d53606915f428987f36fcb Mon Sep 17 00:00:00 2001 From: sansth1010 Date: Wed, 6 Dec 2023 18:01:50 -0600 Subject: [PATCH 1/2] fix durable download urls --- src/helpers/enrich-dataset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/enrich-dataset.ts b/src/helpers/enrich-dataset.ts index 277dbcf..af5ae6a 100644 --- a/src/helpers/enrich-dataset.ts +++ b/src/helpers/enrich-dataset.ts @@ -106,7 +106,7 @@ export function enrichDataset(dataset: HubDataset, hubsite: HubSite): Feature { function generateDurableDownloadUrl(datasetId: string, siteUrl: string, fileType: FileType) { const { itemId, layerId } = parseDatasetId(datasetId); - return `https://${siteUrl}/api/download/v1/item/${itemId}/${fileType}?layers=${layerId}`; + return `https://${siteUrl}/api/download/v1/items/${itemId}/${fileType}?layers=${layerId}`; } function getDatasetKeyword(dataset: HubDataset): string[] { From 34049c54391ca33705134f122ca48ba8846c0eb5 Mon Sep 17 00:00:00 2001 From: sansth1010 Date: Wed, 6 Dec 2023 18:04:49 -0600 Subject: [PATCH 2/2] fix tests --- src/helpers/enrich-dataset.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers/enrich-dataset.test.ts b/src/helpers/enrich-dataset.test.ts index 2eb5dee..1c20209 100644 --- a/src/helpers/enrich-dataset.test.ts +++ b/src/helpers/enrich-dataset.test.ts @@ -70,10 +70,10 @@ describe('enrichDataset function', () => { provenance: '', hubLandingPage: 'https://arcgis.com/maps/CALFIRE::DCAT_Test', downloadLink: 'https://arcgis.com/datasets/CALFIRE::DCAT_Test', - durableUrlCSV: 'https://arcgis.com/api/download/v1/item/123a/csv?layers=0', - durableUrlGeoJSON: 'https://arcgis.com/api/download/v1/item/123a/geojson?layers=0', - durableUrlShapeFile: 'https://arcgis.com/api/download/v1/item/123a/shapefile?layers=0', - durableUrlKML: 'https://arcgis.com/api/download/v1/item/123a/kml?layers=0', + durableUrlCSV: 'https://arcgis.com/api/download/v1/items/123a/csv?layers=0', + durableUrlGeoJSON: 'https://arcgis.com/api/download/v1/items/123a/geojson?layers=0', + durableUrlShapeFile: 'https://arcgis.com/api/download/v1/items/123a/shapefile?layers=0', + durableUrlKML: 'https://arcgis.com/api/download/v1/items/123a/kml?layers=0', agoLandingPage: 'portal.arcgis.com/home/item.html?id=123a&sublayer=0', isLayer: true, license: '',