Skip to content

Commit 9ca395d

Browse files
authored
Merge pull request #51 from hack4impact-calpoly/tyler-duplicate-fix
2 parents 149819d + 3c1df46 commit 9ca395d

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ReferralForm/ReferralForm.tsx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,21 @@ export default function ReferralForm() {
6565
headers: { "Content-Type": "application/json" },
6666
body: JSON.stringify({ em, nm, ref, cs }),
6767
});
68-
69-
const referralData = {
70-
member_name: nm.trim(),
71-
member_email: em,
72-
referral_code: ref,
73-
prospects: prospects.map((prospect) => ({
74-
prospect_name: `${prospect.fullName}`.trim(),
75-
prospect_email: prospect.email,
76-
})),
77-
};
78-
if (!checksumResponse.ok) {
79-
const data = await checksumResponse.json();
80-
setErrorMessage(data.message || "Checksum validation failed.");
81-
return;
82-
}
8368

84-
// Prepare referral data
8569
const referralData = {
8670
member_name: nm.trim(),
8771
member_email: em,
8872
referral_code: ref,
8973
prospects: prospects.map((prospect) => ({
90-
prospect_name: `${prospect.firstName} ${prospect.lastName}`.trim(),
74+
prospect_name: `${prospect.fullName}`.trim(),
9175
prospect_email: prospect.email,
9276
})),
9377
};
78+
if (!checksumResponse.ok) {
79+
const data = await checksumResponse.json();
80+
setErrorMessage(data.message || "Checksum validation failed.");
81+
return;
82+
}
9483

9584
// Submit referral data
9685
const response = await fetch("/api/referral", {

0 commit comments

Comments
 (0)