From 829c32e2b4f230d829023ea523d51df141b97fc1 Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Tue, 16 Apr 2024 14:56:57 +0900 Subject: [PATCH] Update AddAccountForm.tsx --- app/AddAccountForm.tsx | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/app/AddAccountForm.tsx b/app/AddAccountForm.tsx index 7bc1b3d..ef4c2c8 100644 --- a/app/AddAccountForm.tsx +++ b/app/AddAccountForm.tsx @@ -65,7 +65,7 @@ const FormSchema = z.object({ const AddAccountForm: FC = () => { const router = useRouter(); - const { isLoaded, userId } = useAuth(); + const { isLoaded } = useAuth(); const form = useForm>({ mode: "onChange", @@ -78,20 +78,7 @@ const AddAccountForm: FC = () => { const onSubmit = async (values: z.infer) => { try { - if (!userId) { - throw new Error("User not found."); - } - - const valuesWithUserId: { - address: string; - name: string; - userId: string; - } = { - ...values, - userId: userId, - }; - - saveOrUpdateAccount(valuesWithUserId); + saveOrUpdateAccount(values); toast.success("Address has been created"); form.reset(); router.refresh();