Skip to content

Commit

Permalink
Merge pull request #91 from bcgov/ofmcc-1131-update-statecode-facilit…
Browse files Browse the repository at this point in the history
…y-licence

ofmcc-1131 - filter out inactive licences using statecode instead of statuscode
  • Loading branch information
vietle-cgi authored Feb 1, 2024
2 parents 261f749 + 7c2a48e commit d1beef4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/components/facilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function getFacilityContacts(req, res) {

async function getFacilityLicences(req, res) {
try {
const operation = `ofm_licences?$select=ofm_health_authority,ofm_licence,ofm_licenceid,statuscode&$filter=(_ofm_facility_value eq ${req.params.facilityId}) and (statuscode eq 1)`
const operation = `ofm_licences?$select=ofm_health_authority,ofm_licence,ofm_licenceid,statuscode,statecode&$filter=(_ofm_facility_value eq ${req.params.facilityId}) and (statecode eq 0)`
const response = await getOperation(operation)
const licences = []
response?.value?.forEach((item) => licences.push(new MappableObjectForFront(item, LicenceMappings).toJSON()))
Expand Down
1 change: 1 addition & 0 deletions backend/src/util/mapping/Mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ const LicenceMappings = [
{ back: 'ofm_licence', front: 'licence' },
{ back: 'ofm_health_authority', front: 'healthAuthorityId' },
{ back: 'statuscode', front: 'statusCode' },
{ back: 'statecode', front: 'stateCode' },
]

const DocumentMappings = [
Expand Down

0 comments on commit d1beef4

Please sign in to comment.