Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed district router sometimes failing on .find() #164

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-n-deploy-backend-to-ocp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,6 @@ jobs:
oc rollout status dc/${{ env.IMAGE_NAME }}
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.3.0
uses: zaproxy/action-full-scan@v0.10.0
with:
target: "https://${{ env.HOST_ROUTE }}"
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to.openshift-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ jobs:
oc rollout status dc/${{ env.IMAGE_NAME }}
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.3.0
uses: zaproxy/action-full-scan@v0.10.0
with:
target: "https://${{ env.HOST_ROUTE }}"
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to.openshift-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ jobs:
oc rollout status dc/${{ env.IMAGE_NAME }}
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.3.0
uses: zaproxy/action-full-scan@v0.10.0
with:
target: "https://${{ env.HOST_ROUTE }}"
10 changes: 5 additions & 5 deletions backend/src/components/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function removeFieldsByCriteria(inputData, criteria) {
}
function appendMailingAddressDetailsAndRemoveAddresses(data) {
if (data && data.addresses && data.addresses.length > 0) {
const physicalAddress = data.addresses.find(
const physicalAddress = data.addresses?.find(
(address) => address.addressTypeCode === "PHYSICAL"
);
if (physicalAddress) {
Expand All @@ -101,7 +101,7 @@ function appendMailingAddressDetailsAndRemoveAddresses(data) {

// Remove the "addresses" property
}
const courierAddress = data.addresses.find(
const courierAddress = data.addresses?.find(
(address) => address.addressTypeCode === "MAILING"
);
if (courierAddress) {
Expand Down Expand Up @@ -132,7 +132,7 @@ function appendMailingAddressDetailsAndRemoveAddresses(data) {
function addDistrictLabels(jsonData, districtList) {
if (jsonData.content && Array.isArray(jsonData.content)) {
jsonData.content.forEach((dataItem) => {
const district = districtList.find(
const district = districtList?.find(
(item) => item.districtId === dataItem.districtId
);
if (district) {
Expand Down Expand Up @@ -229,7 +229,7 @@ function normalizeJsonObject(
includeFields
) {
return sourceArray.map((item) => {
const matchingItem = referenceArray.find(
const matchingItem = referenceArray?.find(
(info) =>
info[matchKey] === item[matchKey] && (!condition || condition(info))
);
Expand Down Expand Up @@ -402,7 +402,7 @@ function createSchoolCache(schoolData, schoolGrades) {
});

// Extract and format principal contact information if it exists
const principalContact = school.contacts.find(
const principalContact = school.contacts?.find(
(contact) => contact.schoolContactTypeCode === "PRINCIPAL"
);
if (principalContact) {
Expand Down
Loading