Skip to content

Commit 6091360

Browse files
committed
fix: account fetching
1 parent 99cabb5 commit 6091360

File tree

1 file changed

+8
-4
lines changed
  • apps/dashboard/src/app/onboarding

1 file changed

+8
-4
lines changed

apps/dashboard/src/app/onboarding/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ export default function OnboardingPage({
176176
});
177177

178178
const onSubmit: SubmitHandler<FormData> = async (data) => {
179-
console.log(data);
179+
const account = await accountQuery.refetch();
180+
if (!account.data?.id) {
181+
throw new Error("No account found");
182+
}
183+
180184
const res = await fetch(
181185
`${THIRDWEB_ANALYTICS_API_HOST}/v1/preferences/account`,
182186
{
@@ -185,7 +189,7 @@ export default function OnboardingPage({
185189
"Content-Type": "application/json",
186190
},
187191
body: JSON.stringify({
188-
accountId: accountQuery.data?.id,
192+
accountId: account.data.id,
189193
userType: data.userType,
190194
role: data.role,
191195
industry: data.industry,
@@ -516,8 +520,8 @@ export default function OnboardingPage({
516520
event.preventDefault(); // Prevent default behavior
517521
const newInterests = isChecked
518522
? checkedInterests.filter(
519-
(key) => key !== interest.key,
520-
)
523+
(key) => key !== interest.key,
524+
)
521525
: [...checkedInterests, interest.key];
522526
form.setValue("interests", newInterests);
523527
}}

0 commit comments

Comments
 (0)