fixed some missed data, added role based function(user)

This commit is contained in:
Jelaletdin12
2026-08-31 19:18:42 +05:00
parent 5884ec831c
commit 9ad86634dd
31 changed files with 1276 additions and 977 deletions

View File

@@ -36,6 +36,13 @@ export interface AuthUser {
createdAt?: string;
}
/** Returns the role-appropriate landing page for the current user. */
export function getHomePath(): string {
const user = useAuthStore.getState().user;
const isAdmin = user?.role?.code === "admin";
return isAdmin ? "/dashboard" : "/loan-orders";
}
interface AuthState {
token: string | null;
refreshTokenValue: string | null;