Update onboarding and product edit flows

This commit is contained in:
2026-05-08 09:47:03 +07:00
parent a1e20ccd9b
commit 0aa5227943
9 changed files with 334 additions and 83 deletions

View File

@ -59,27 +59,6 @@ export default function LoginPage() {
}
if (data.role === "seller") {
// Check seller profile completeness
try {
const profileRes = await fetch("/api/seller/profile", {
headers: { "x-auth-token": data.token },
});
const profileData = await profileRes.json();
const profile = profileData?.data || profileData;
const isIncomplete =
!profile?.storeName &&
!profile?.biography &&
!profile?.sellerImageUrl;
if (isIncomplete || data.onboardingRequired) {
router.push("/onboarding/business");
return;
}
} catch {
// If profile check fails, still proceed to dashboard
}
router.push("/dashboard");
return;
}

View File

@ -125,7 +125,7 @@ function VerifyContent() {
sessionStorage.removeItem("otpVerified");
sessionStorage.removeItem("otpVerifiedEmail");
setSuccess(v.successSeller);
setTimeout(() => { router.push("/onboarding/business"); }, 1000);
setTimeout(() => { router.push("/dashboard"); }, 1000);
return;
}