From ace3decdaae4215b8b6e69ae0ad1d2f769dffc5a Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Thu, 12 Jun 2025 22:02:57 +0700 Subject: [PATCH] fix:fixing base on prod --- app/(admin)/settings/page.tsx | 10 ++++++---- components/form/login.tsx | 14 +++++++------- components/landing/HeaderNews.tsx | 6 +++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/(admin)/settings/page.tsx b/app/(admin)/settings/page.tsx index 69d900d..c16d1d3 100644 --- a/app/(admin)/settings/page.tsx +++ b/app/(admin)/settings/page.tsx @@ -11,12 +11,14 @@ export default function Settings() { const [profile, setProfile] = useState(); const uid = Cookies.get("uie"); useEffect(() => { - initFetch(); - }, []); + if (!profile) { + initFetch(); + } + }, [profile]); const initFetch = async () => { loading(); - const profile = await getDetailMasterUsers(String(uid)); - // const profile = await getProfile(); + // const profile = await getDetailMasterUsers(String(uid)); + const profile = await getProfile(); setProfile(profile?.data?.data); close(); }; diff --git a/components/form/login.tsx b/components/form/login.tsx index 45834b2..d4d792f 100644 --- a/components/form/login.tsx +++ b/components/form/login.tsx @@ -254,15 +254,15 @@ export default function Login() { Cookies.set("username", profile?.username, { expires: 1, }); - Cookies.set("urie", profile?.roleId, { - expires: 1, - }); - Cookies.set("roleName", profile?.roleName, { - expires: 1, - }); - Cookies.set("masterPoldaId", profile?.masterPoldaId, { + Cookies.set("urie", profile?.userRoleId, { expires: 1, }); + // Cookies.set("roleName", profile?.roleName, { + // expires: 1, + // }); + // Cookies.set("masterPoldaId", profile?.masterPoldaId, { + // expires: 1, + // }); Cookies.set("ulne", profile?.userLevelId, { expires: 1, }); diff --git a/components/landing/HeaderNews.tsx b/components/landing/HeaderNews.tsx index 3078420..141f9fd 100644 --- a/components/landing/HeaderNews.tsx +++ b/components/landing/HeaderNews.tsx @@ -286,8 +286,8 @@ export default function HeaderNews() {
headernews handleImageLoad(e, index)} src={ newsItem?.thumbnailUrl === "" @@ -297,7 +297,7 @@ export default function HeaderNews() { className={`!object-cover !rounded-none ${ portraitMap[index] ? "!w-auto object-cover mx-auto" - : "!w-[90vw]" + : "!w-full" } !h-[500px]`} />