mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +00:00
fix: make vessel registeration in its own routes
This commit is contained in:
@@ -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 ??
|
||||
|
||||
Reference in New Issue
Block a user