Skip to content

Commit

Permalink
Merge pull request #161 from bcgov/Release/v1.6.3
Browse files Browse the repository at this point in the history
Release/v1.6.3
  • Loading branch information
michaeltangbcgov authored Mar 22, 2024
2 parents ce6314e + 6b81cc1 commit 06c0699
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backend/src/routes/institute-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,13 @@ async function getDistrictContactsAPI(req, res) {
.then((response) => {
if (req.url.includes("/district/contact/paginated")) {
const jsonData = addDistrictLabels(response.data, districtList);
let nonBCDistrictIds = nonBCDistrictList.map(district => district.districtId);
nonBCDistrictIds.push("8e34ab4d-f387-220b-b54e-2c9a7f380f85");
jsonData.content = jsonData.content.filter(contact => !nonBCDistrictIds.includes(contact.districtId));


jsonData.content = jsonData.content.filter(contact => {
// Check if districtId is not undefined, empty, or null
return contact.districtNumber !== undefined
&& contact.districtNumber !== ""
&& contact.districtNumber !== null;
});
res.json(jsonData);
} else {
res.json(response.data);
Expand Down

0 comments on commit 06c0699

Please sign in to comment.