From 6b81cc16a8e54e4645525dd589921b9a528c5acf Mon Sep 17 00:00:00 2001 From: Shaun Lum Date: Fri, 22 Mar 2024 12:58:44 -0700 Subject: [PATCH] Release/v1.6.3 --- backend/src/routes/institute-router.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/routes/institute-router.js b/backend/src/routes/institute-router.js index 4bf6be3..2b0ebf9 100644 --- a/backend/src/routes/institute-router.js +++ b/backend/src/routes/institute-router.js @@ -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);