Skip to content

Commit

Permalink
Merge pull request #507 from USEPA/feature/update-2024-prf-data
Browse files Browse the repository at this point in the history
Feature/update 2024 prf data
  • Loading branch information
courtneymyers authored Nov 27, 2024
2 parents 4a99701 + 5ec9f2f commit 9adbe1e
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/server/app/utilities/formio.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,16 +552,20 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
County__c,
} = Account || {};

const jsonOrg = frf2024RecordJson.data.organizations.find((org) => {
const matchedName = org?.org_orgName?.trim() === orgName?.trim();
const matchedEmail =
org.org_contactEmail?.trim()?.toLowerCase() ===
Email?.trim()?.toLowerCase();

return matchedName && matchedEmail;
});

const orgAlreadyAdded = array.some((org) => org._org_id === orgId);
const jsonOrg = frf2024RecordJson.data.org_organizations.find(
(org) => {
const matchedName = org?.org_name?.trim() === orgName?.trim();
const matchedEmail =
org.org_contact_email?.trim()?.toLowerCase() ===
Email?.trim()?.toLowerCase();

return matchedName && matchedEmail;
},
);

const orgAlreadyAdded = array.some(
(org) => org._bap_org_id === orgId,
);

/**
* Ensure the org exists in the 2024 FRF submission's
Expand Down

0 comments on commit 9adbe1e

Please sign in to comment.