fix: make vessel registeration in its own routes

This commit is contained in:
mengstabketemaw
2026-07-08 16:46:27 +03:00
parent de37c6940e
commit 1471c797d9
9 changed files with 80 additions and 358 deletions

View File

@@ -75,6 +75,7 @@ export function LoginPage() {
dispatch(setUser(me));
let hasProfile = false;
let profileType: string | undefined;
try {
const q = `w=user_id:=:${me.id}&i=user,address,profession`;
const result = await profileCheckTrigger({
@@ -83,6 +84,7 @@ export function LoginPage() {
}).unwrap();
if (result.total > 0 && result.items.length > 0) {
const profile = result.items[0];
profileType = 'VESSEL_OWNER';
authStorage.setProfileId(profile.id);
dispatch(setCurrentProfile(profile));
hasProfile = true;
@@ -107,7 +109,7 @@ export function LoginPage() {
return;
}
navigate(loginRedirectPath);
navigate(profileType === 'VESSEL_OWNER' ? '/vessel-owner/dashboard' : loginRedirectPath);
} catch (err: unknown) {
const msg =
(err as { data?: { message?: string } })?.data?.message ??