diff --git a/src/controllers/allocations.controller.ts b/src/controllers/allocations.controller.ts index 426b664..3185d2a 100644 --- a/src/controllers/allocations.controller.ts +++ b/src/controllers/allocations.controller.ts @@ -387,8 +387,9 @@ export class AllocationsController { async allocationsRadialChartInLocation( @param.path.string('countryCode') countryCode: string, ) { + const decodedCode = countryCode.replace(/\|/g, '%2F'); let filterString = filterFinancialIndicators( - {...this.req.query, geographies: countryCode}, + {...this.req.query, geographies: decodedCode}, AllocationRadialFieldsMapping.urlParamsLocation, 'geography/code', 'activityArea/name', diff --git a/src/controllers/location.controller.ts b/src/controllers/location.controller.ts index fdc2cf7..eb9153c 100644 --- a/src/controllers/location.controller.ts +++ b/src/controllers/location.controller.ts @@ -17,9 +17,19 @@ export class LocationController { @get('/location/{code}/grants/pie-charts') @response(200) async locationGrantsPieCharts(@param.path.string('code') code: string) { - let filterString1 = PieChartsMapping.pie1UrlParams.replace('', code); - let filterString2 = PieChartsMapping.pie2UrlParams.replace('', code); - let filterString3 = PieChartsMapping.pie3UrlParams.replace('', code); + const decodedCode = code.replace(/\|/g, '%2F'); + let filterString1 = PieChartsMapping.pie1UrlParams.replace( + '', + decodedCode, + ); + let filterString2 = PieChartsMapping.pie2UrlParams.replace( + '', + decodedCode, + ); + let filterString3 = PieChartsMapping.pie3UrlParams.replace( + '', + decodedCode, + ); filterString1 = filterString1.replace('', ''); filterString2 = filterString2.replace('', ''); filterString3 = filterString3.replace('', ''); @@ -302,25 +312,26 @@ export class LocationController { @get('/location/{code}/info') @response(200) async locationInfo(@param.path.string('code') code: string) { + const decodedCode = code.replace(/\|/g, '%2F'); const url = `${urls.GEOGRAPHIES}/${LocationInfoMapping.urlParams.replace( '', - code, + decodedCode, )}`; const FPMurl = `${urls.GRANTS}/${LocationInfoMapping.FPMurlParams.replace( '', - code, + decodedCode, )}`; const currPrincipalRecipientsUrl = `${ urls.GRANTS }/${LocationInfoMapping.currentPrincipalRecipientsUrlParams.replace( '', - code, + decodedCode, )}`; const formerPrincipalRecipientsUrl = `${ urls.GRANTS }/${LocationInfoMapping.formerPrincipalRecipientsUrlParams.replace( '', - code, + decodedCode, )}`; return axios @@ -413,9 +424,10 @@ export class LocationController { async locationCoordinatingMechanismContacts( @param.path.string('code') code: string, ) { + const decodedCode = code.replace(/\|/g, '%2F'); const filterString = CoordinatingMehanismContactsMapping.urlParams.replace( '', - code, + decodedCode, ); const url = `${urls.COORDINATING_MECHANISMS}/${filterString}`;