Skip to content

Commit

Permalink
Release/v1.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunlumbcgov committed Mar 22, 2024
1 parent f9ab319 commit 6b81cc1
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 6b81cc1

Please sign in to comment.