Skip to content

Commit

Permalink
[FEATURE][CU-86dtvhgdb] Add column to the incomplete profiles (#183)
Browse files Browse the repository at this point in the history
* feat: add the flow as obfuscated to the backend

* feat: change word for number as string

* feat: pass compiled version
  • Loading branch information
cgarcia-lightit authored Jun 24, 2024
1 parent 665b8a0 commit 2fcc3d9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 19 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/eo_web/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"css": [
"assets/main-17ed8018.css"
],
"file": "assets/main-33e11077.js",
"file": "assets/main-6aa514b9.js",
"isEntry": true,
"src": "src/main.tsx"
}
Expand Down
1 change: 1 addition & 0 deletions apps/eo_web/src/api/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ interface CreatePreProfileParams {
last_name: string;
email: string;
phone_number: string;
origin: string;
}

export const useApi = () => {
Expand Down
41 changes: 40 additions & 1 deletion apps/eo_web/src/screens/AccountCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { usePreProfile } from "~/api/usePreProfile";
import { useMount } from "~/hooks/useMount";
import { LayoutDefault } from "~/layouts";
import { ROUTES } from "~/router";
import { useProfilingStore } from "~/stores/useProfilingStore";
import {
Flows,
useProfilingStore,
type FlowType,
} from "~/stores/useProfilingStore";


export const signUpSchema = z.object({
Expand Down Expand Up @@ -71,6 +75,7 @@ export const AccountCreation = () => {
channel,
setState,
setExperience,
flow,
} = useProfilingStore((state) => state);
const { eligibleEmail } = useApi();

Expand All @@ -89,6 +94,39 @@ export const AccountCreation = () => {
const errorMessage =
Object.keys(errors).length === 0 ? "" : Object.values(errors)[0];

const getIndex = (input: FlowType): string => {
switch (input) {
case Flows.cancer_pilot:
return "1";
case Flows.twist_out_cancer:
return "2";
case Flows.cancer_support_community:
return "3";
case Flows.resource_center_1:
return "4";
case Flows.resource_center_2:
return "5";
case Flows.employer_center:
return "6";
case Flows.inova:
return "7";
case Flows.uva:
return "8";
case Flows.imerman:
return "9";
case Flows.unite_for_her:
return "10";
case Flows.mass_retirees:
return "11";
case Flows.stupid_cancer:
return "12";
case Flows.marketing_site:
return "13";
case Flows.c_org:
return "14";
}
};

const onFormSubmission = async (data: SignUpFormSchema) => {
setValidatingForm(true);
const result = await eligibleEmail(data.email);
Expand All @@ -106,6 +144,7 @@ export const AccountCreation = () => {
last_name: data.lastName,
email: data.email,
phone_number: data.phoneNumber.replace(/\D/g, ""),
origin: getIndex(flow),
});
switch (channel) {
case "cancer":
Expand Down

0 comments on commit 2fcc3d9

Please sign in to comment.