Fix version 1.2.16
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const dataUser = await funGlobal_getUserById({
|
||||
userId: userLoginId as string,
|
||||
});
|
||||
|
||||
if (dataUser?.masterUserRoleId != "1")
|
||||
return redirect(RouterAdminDashboard.splash_admin);
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ export default async function Layout({
|
||||
const authorId = dataProfile?.userId;
|
||||
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const userRoleId = dataProfile?.User?.masterUserRoleId;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -21,6 +22,7 @@ export default async function Layout({
|
||||
profileId={profileId}
|
||||
userLoginId={userLoginId as string}
|
||||
authorId={authorId as any}
|
||||
userRoleId={userRoleId as string}
|
||||
>
|
||||
{children}
|
||||
</KatalogLayout>
|
||||
|
||||
Reference in New Issue
Block a user