diff --git a/src/server/controller/cycleData/getBulkDownload/getFRAYearsData.ts b/src/server/controller/cycleData/getBulkDownload/getFRAYearsData.ts index 1e7b8628bf..671d931cbe 100644 --- a/src/server/controller/cycleData/getBulkDownload/getFRAYearsData.ts +++ b/src/server/controller/cycleData/getBulkDownload/getFRAYearsData.ts @@ -28,11 +28,12 @@ export const getFraYearsData = async (props: Props) => { const years = Years.fraYears(cycle) - return countries.flatMap(({ countryIso, regionCodes }) => + return countries.flatMap(({ countryIso, regionCodes, props: { deskStudy } }) => years.flatMap>((year: string) => { const base: Record = { regions: regionCodes.join(';'), iso3: countryIso, + deskStudy: deskStudy ? 'assessment.deskStudy' : '', name: countryIso, year, boreal: getClimaticValue('boreal', countryIso, climaticData), diff --git a/src/server/controller/cycleData/getBulkDownload/index.ts b/src/server/controller/cycleData/getBulkDownload/index.ts index b20af43e8c..54f11cd530 100644 --- a/src/server/controller/cycleData/getBulkDownload/index.ts +++ b/src/server/controller/cycleData/getBulkDownload/index.ts @@ -28,6 +28,7 @@ const _convertToCSV = (arr: Array>): string => { const fixedHeaders = [ 'regions', 'iso3', + 'deskStudy', 'name', 'year', 'forest area 2020', @@ -54,7 +55,7 @@ const _getFileName = (name: string): string => { return `${name}_${timestamp}.csv` } -const handleResult = ({ regions, iso3, name, year, ...row }: Record, i18n: i18nType) => { +const handleResult = ({ regions, iso3, deskStudy, name, year, ...row }: Record, i18n: i18nType) => { const _translate = (key: string) => i18n.t(Areas.getTranslationKey(key as RegionCode | CountryIso)) const _handleRegions = (regions: string): string => { @@ -64,6 +65,7 @@ const handleResult = ({ regions, iso3, name, year, ...row }: Record = { regions: _handleRegions(regions), iso3: `"${iso3}"`, + deskStudy: `"${i18n.t(deskStudy)}"`, name: `"${_translate(name)}"`, ...row, }