This commit is contained in:
Kenneth Jannette
2024-03-23 02:23:16 -05:00
parent 9db9e03755
commit b51cdeb857
5 changed files with 216 additions and 124 deletions

View File

@@ -6,7 +6,6 @@ import { v4 as uuidv4 } from "uuid";
import arrow from "../../Assets/Images/Arrow.png";
import { useNavigate } from "react-router-dom";
import ConfirmModal from "../Modals/ConfirmModal";
import { marchEmailPrm } from "../../secrets";
import { createUserWithEmailAndPassword } from "firebase/auth";
import { stateDataValues } from "../../Constants/Fields/SignupFields";
import "../../styles/homepage.scss";
@@ -33,13 +32,17 @@ const HomePage = () => {
subscriptionPeriodStart,
subscriptionPeriodEnd,
subscriptionId,
isPromotionalMebership,
isPromotionalMebership = true,
docsAllowedPeMonth = 1
) {
if (!email || !password) {
if (!email || !password || !dataValues[0]) {
return;
}
console.log(
"~~~~~~~~~~~~~~~~~~~~~email, password in saveUserData",
email,
password
);
const appUserId = uuidv4();
const firmId = uuidv4();
const fbAuthUid = authId;
@@ -64,12 +67,24 @@ const HomePage = () => {
zipCode,
barNumber,
practiceArea,
} = dataValues;
} = dataValues[0];
const userState = stateDataValues.filter((value) => {
if (value.name === state) return value;
});
console.log(
"firstName, lastName, firm, telephone, streetAddress, city, state, zipCode, barNumber, practiceArea",
firstName,
lastName,
firm,
telephone,
streetAddress,
city,
state,
zipCode,
barNumber,
practiceArea
);
const userData = {
docsAllowedPerMonth,
docsGenerated,
@@ -88,6 +103,7 @@ const HomePage = () => {
practiceArea,
email,
isPromotionalMebership,
isPromotionalFirstLogin: true,
customerId: customerId,
subscriptionId: subscriptionId,
subscriptionPlan: "flordia-spring-promo-plan",
@@ -158,12 +174,13 @@ const HomePage = () => {
const user = userCredential.user;
dataValues = { ...dataValues };
const isPromotionalMebership = true;
console.log("userCredential", userCredential);
const res = await saveUserData(
user.uid,
dataValues,
email,
password,
customerId,
subscriptionCreated,
subscriptionPeriodStart,