more
This commit is contained in:
@@ -73,6 +73,7 @@ const SignupPage = () => {
|
|||||||
|
|
||||||
const handleConfirmPromoCode = () => {
|
const handleConfirmPromoCode = () => {
|
||||||
if (issueText === marchEmailPrm) {
|
if (issueText === marchEmailPrm) {
|
||||||
|
setIsPromoMembership(true);
|
||||||
handlePromoSignup();
|
handlePromoSignup();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -179,7 +180,13 @@ const SignupPage = () => {
|
|||||||
const firmId = uuidv4();
|
const firmId = uuidv4();
|
||||||
const fbAuthUid = authId;
|
const fbAuthUid = authId;
|
||||||
const plan = selectedPlan;
|
const plan = selectedPlan;
|
||||||
const docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth;
|
let docsAllowedPerMonth;
|
||||||
|
|
||||||
|
if (isPromoMembership) {
|
||||||
|
docsAllowedPerMonth = 1;
|
||||||
|
} else {
|
||||||
|
docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth;
|
||||||
|
}
|
||||||
|
|
||||||
const docsGenerated = 0;
|
const docsGenerated = 0;
|
||||||
|
|
||||||
@@ -417,19 +424,17 @@ const SignupPage = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//const planType = determinePlan(isAnnual, activeRadioOption);
|
|
||||||
|
|
||||||
if (dataValues) {
|
if (dataValues) {
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
setIsBusy(true);
|
setIsBusy(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//const customerId = data.data.customerId;
|
//const customerId = data.data.customerId;
|
||||||
|
const today = new Date();
|
||||||
const subscriptionCreated = new Date();
|
const subscriptionCreated = today;
|
||||||
const subscriptionPeriodStart = subscriptionCreated;
|
const subscriptionPeriodStart = today;
|
||||||
//const subscriptionPeriodEnd = 30 days from date created
|
const subscriptionPeriodEnd = today.setDate(today.getDate() + 30);
|
||||||
const subscriptionId = uuidv4();
|
const subscriptionId = `promo-${uuidv4()}`;
|
||||||
const isPromotionalMebership = true;
|
const isPromotionalMebership = true;
|
||||||
|
|
||||||
const userCredential = await createUserWithEmailAndPassword(
|
const userCredential = await createUserWithEmailAndPassword(
|
||||||
@@ -443,7 +448,6 @@ const SignupPage = () => {
|
|||||||
const res = await saveUserData(
|
const res = await saveUserData(
|
||||||
user.uid,
|
user.uid,
|
||||||
dataValues,
|
dataValues,
|
||||||
|
|
||||||
subscriptionCreated,
|
subscriptionCreated,
|
||||||
subscriptionPeriodStart,
|
subscriptionPeriodStart,
|
||||||
subscriptionPeriodEnd,
|
subscriptionPeriodEnd,
|
||||||
|
|||||||
Reference in New Issue
Block a user