Fix: event
Deskripsi: - Create event konfirmasi
This commit is contained in:
40
src/app/dev/event/konfirmasi/[id]/page.tsx
Normal file
40
src/app/dev/event/konfirmasi/[id]/page.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import Ui_Konfirmasi from "@/app_modules/event/_ui/konfirmasi";
|
||||
import {
|
||||
event_funCheckKehadiran,
|
||||
event_funCheckPesertaByUserId,
|
||||
} from "@/app_modules/event/fun";
|
||||
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const eventId = params.id;
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const dataEvent = await event_getOneById(eventId);
|
||||
|
||||
const checkPeserta = await event_funCheckPesertaByUserId({
|
||||
eventId: eventId,
|
||||
userId: userLoginId as string,
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (dataEvent?.isArsip)
|
||||
return redirect(`/dev/event/detail/riwayat/${dataEvent.id}`);
|
||||
|
||||
if (checkPeserta == false)
|
||||
return redirect(`/dev/event/detail/main/${eventId}`);
|
||||
|
||||
// if (checkKehadiran) {
|
||||
// return redirect(`/dev/event/main/beranda`);
|
||||
// }
|
||||
|
||||
return (
|
||||
<>
|
||||
<Ui_Konfirmasi
|
||||
dataEvent={dataEvent as any}
|
||||
userLoginId={userLoginId as string}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4,8 +4,6 @@ import { HomeView } from "@/app_modules/home";
|
||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import { job_getTwoForHomeView } from "@/app_modules/job/fun/get/get_two_for_home_view";
|
||||
import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function PageHome() {
|
||||
@@ -20,8 +18,8 @@ export default async function PageHome() {
|
||||
// if (dataUser?.active === false) {
|
||||
// return redirect(RouterHome.home_user_non_active);
|
||||
// }
|
||||
if (dataUser?.masterUserRoleId === "2" || dataUser?.masterUserRoleId === "3")
|
||||
return redirect(RouterAdminDashboard.main_admin);
|
||||
// if (dataUser?.masterUserRoleId === "2" || dataUser?.masterUserRoleId === "3")
|
||||
// return redirect(RouterAdminDashboard.main_admin);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user