11import AlertCircle from "@/assets/icons/alert-circle.svg?react" ;
2- import { AwarenessForm } from "@/components/survey/AwarenessChannel " ;
3- import { AwarenessFormType } from "@/components/survey/form-schemas" ;
2+ import { InfrastructureForm } from "@/components/survey/Infrastructure " ;
3+ import { InfrastructureFormType } from "@/components/survey/form-schemas" ;
44import { useActivateUser } from "@/data/users/activate-user-mutation" ;
55import { useToast } from "@zenml-io/react-component-library" ;
66import { useActivationContext } from "./ActivationContext" ;
@@ -15,7 +15,7 @@ type Props = {
1515 setUsername : Dispatch < SetStateAction < string > > ;
1616} ;
1717
18- export function AwarenessStep ( { userId, setUsername } : Props ) {
18+ export function InfraStep ( { userId, setUsername } : Props ) {
1919 const { newUser } = useActivationContext ( ) ;
2020 const { setAuthState } = useAuthContext ( ) ;
2121 const { setSurveyStep } = useSurveyContext ( ) ;
@@ -44,14 +44,17 @@ export function AwarenessStep({ userId, setUsername }: Props) {
4444 }
4545 } ) ;
4646
47- function handleAwarenessFormSubmit ( { other, channels, otherVal } : AwarenessFormType ) {
48- const channelArr = other ? [ ...channels , otherVal ] : channels ;
49- const updateMetadata : UserMetadata = { awareness_channels : channelArr as string [ ] } ;
47+ function handleInfraFormSubmit ( { other, providers, otherVal } : InfrastructureFormType ) {
48+ const providerArr = other ? [ ...providers , otherVal ] : providers ;
49+ const updateMetadata : UserMetadata = {
50+ infra_providers : providerArr as string [ ] ,
51+ finished_onboarding_survey : true
52+ } ;
5053 mutate ( {
5154 userId,
5255 body : { ...newUser , user_metadata : { ...newUser . user_metadata , ...updateMetadata } }
5356 } ) ;
5457 }
5558
56- return < AwarenessForm submitHandler = { handleAwarenessFormSubmit } /> ;
59+ return < InfrastructureForm submitHandler = { handleInfraFormSubmit } /> ;
5760}
0 commit comments