From 06f98ec8a983cc07e2dd0462adc4a0509e01d63f Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 27 Jan 2024 14:15:28 -0600 Subject: [PATCH] more --- src/Components/SignupPage/SignupPage.js | 4 ++- src/Utils/Miscutils.js | 33 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/Utils/Miscutils.js diff --git a/src/Components/SignupPage/SignupPage.js b/src/Components/SignupPage/SignupPage.js index 5d916ba..0c2665f 100644 --- a/src/Components/SignupPage/SignupPage.js +++ b/src/Components/SignupPage/SignupPage.js @@ -18,6 +18,7 @@ import { isFormDataHasErrors, } from "../../Utils/Form"; import { objectMap } from "../../Utils/Object"; +import { determinePlan } from "../../Utils/Miscutils"; import { signupFields } from "../../Constants/Fields/SignupFields"; import { paymentfields } from "../../Constants/Fields/PaymentFields"; import { signupRadioFields } from "../../Constants/Fields/RadioFields"; @@ -141,7 +142,7 @@ const SignupPage = () => { console.log(`Error saving new user to db: ${error}`); } } - + console.log("activeRadioOption", activeRadioOption); const handleProceedToPayment = (e) => { e.preventDefault(); @@ -258,6 +259,7 @@ const SignupPage = () => { return; } + const planType = determinePlan(isAnnual, activeRadioOption); setIsBusy(true); if (paymentDataValues && dataValues) { diff --git a/src/Utils/Miscutils.js b/src/Utils/Miscutils.js new file mode 100644 index 0000000..2fb0285 --- /dev/null +++ b/src/Utils/Miscutils.js @@ -0,0 +1,33 @@ +export const determinePlan = (isAnnual, activeRadioOption) => { + if (isAnnual === true && activeRadioOption === "Associate") { + return { + planType: "Annual Assoc", + planId: "8a7b889e-8626-4d3e-a37d-ef2a8b762419", + }; + } else if (isAnnual === false && activeRadioOption === "Associate") { + return { + planType: "Monthly Assoc", + planId: "4e177c87-d074-4409-9f5e-6358adff5017", + }; + } else if (isAnnual === true && activeRadioOption === "Partner") { + return { + planType: "Annual Partner", + planId: "45b567bc-c1fb-47dd-bfb1-c180380141bc", + }; + } else if (isAnnual === false && activeRadioOption === "Partner") { + return { + planType: "Monthly Partner", + planId: "c70bc329-9c17-4997-a7d3-fe8f62db49b0", + }; + } else if (isAnnual === true && activeRadioOption === "Senior Partner") { + return { + planType: "Annual Senior Partner", + planId: "35b3109c-5fe3-46e3-a64c-1f43fe7136c4", + }; + } else if (isAnnual === false && activeRadioOption === "Senior Partner") { + return { + planType: "Monthly Senior Partner", + planId: "a88ce618-cee2-42ae-ab4c-e404b2a5422d", + }; + } +};