Skip to content

Commit

Permalink
fix: double encode when save sone filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-BOUYAHIA committed Jun 20, 2024
1 parent e8f7b0a commit 2fa10ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mappers/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ const mapGenericToRequestParams = (filters: GenericFilter, type: ResourceType) =
)}`
)
if (encounterStatus && encounterStatus.length > 0) {
const encounterStatusUrl = encodeURIComponent(`${ENCOUNTER_STATUS}|`)
const encounterStatusUrl = `${ENCOUNTER_STATUS}|`
const urlString = encounterStatus.map((elem) => encounterStatusUrl + elem.id).join(',')
requestParams.push(`${getGenericKeyFromResourceType(type, 'ENCOUNTER_STATUS')}=${encodeURIComponent(urlString)}`)
}
Expand Down Expand Up @@ -484,7 +484,7 @@ const mapConditionToRequestParams = (filters: PMSIFilters) => {
const { diagnosticTypes, code, source, nda, endDate, startDate, executiveUnits, encounterStatus } = filters
const requestParams: string[] = []
if (diagnosticTypes && diagnosticTypes.length > 0) {
const diagnosticTypesUrl = encodeURIComponent(`${CONDITION_STATUS}|`)
const diagnosticTypesUrl = `${CONDITION_STATUS}|`
const urlString = diagnosticTypes.map((elem) => diagnosticTypesUrl + elem.id).join(',')
requestParams.push(`${ConditionParamsKeys.DIAGNOSTIC_TYPES}=${encodeURIComponent(urlString)}`)
}
Expand Down Expand Up @@ -530,7 +530,7 @@ const mapPrescriptionToRequestParams = (filters: MedicationFilters) => {
const { prescriptionTypes, nda, endDate, startDate, executiveUnits, encounterStatus } = filters
const requestParams: string[] = []
if (prescriptionTypes && prescriptionTypes.length > 0) {
const prescriptionTypesUrl = encodeURIComponent(`${MEDICATION_PRESCRIPTION_TYPES}|`)
const prescriptionTypesUrl = `${MEDICATION_PRESCRIPTION_TYPES}|`
const urlString = prescriptionTypes.map((elem) => prescriptionTypesUrl + elem.id).join(',')
requestParams.push(`${PrescriptionParamsKeys.PRESCRIPTION_TYPES}=${encodeURIComponent(urlString)}`)
}
Expand All @@ -547,7 +547,7 @@ const mapAdministrationToRequestParams = (filters: MedicationFilters) => {
const { administrationRoutes, nda, endDate, startDate, executiveUnits, encounterStatus } = filters
const requestParams: string[] = []
if (administrationRoutes && administrationRoutes.length > 0) {
const administrationRoutesUrl = encodeURIComponent(`${MEDICATION_ADMINISTRATIONS}|`)
const administrationRoutesUrl = `${MEDICATION_ADMINISTRATIONS}|`
const urlString = administrationRoutes.map((elem) => administrationRoutesUrl + elem.id).join(',')
requestParams.push(`${AdministrationParamsKeys.ADMINISTRATION_ROUTES}=${encodeURIComponent(urlString)}`)
}
Expand Down

0 comments on commit 2fa10ed

Please sign in to comment.