Skip to content

Commit

Permalink
Update SignUpInformationScreen.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
gmat224 committed Dec 22, 2024
1 parent 9d0b5b0 commit b2a7813
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web/src/screens/SignUpInformationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import TextQuestion from "@components/forms/TextQuestion";
import DropdownQuestion from "@components/forms/DropdownQuestion";
import { useState } from "react";
import { updateUserInfo } from "../api/apiRequests";
// import { updateUserInfo } from "../api/apiRequests";
import { useUpdateUserInfo } from "../hooks/api/useUpdateUserInfo";
import LoadingSpinner from "@components/navigation/LoadingSpinner";

Expand Down Expand Up @@ -49,10 +49,11 @@ export default function SignUpInformationScreen({

const [formError, setFormError] = useState(false);

const { status, mutateAsync } = useUpdateUserInfo();
const {status, mutateAsync} = useUpdateUserInfo()

const sendSignUpData = async (data: SignUpSchemaType) => {
mutateAsync(data);

mutateAsync(data)
};

const onSubmit: SubmitHandler<SignUpSchemaType> = (data) => {
Expand Down Expand Up @@ -85,16 +86,16 @@ export default function SignUpInformationScreen({
{ id: 3, text: "None" },
];

if (status === "success") {
if (status === "success"){
window.location.href = "/membership";
}

if (status === "error") {
if (status === "error"){
setFormError(true);
}

if (status === "pending") {
return <LoadingSpinner />;
if (status === "pending"){
return <LoadingSpinner/>
}

return (
Expand Down

0 comments on commit b2a7813

Please sign in to comment.