Fix event

Deskripsi:
- Fix user server menjadi API di beranda
This commit is contained in:
2024-12-06 13:51:39 +08:00
parent 72cd56deb8
commit 2b08326bed
22 changed files with 476 additions and 235 deletions

View File

@@ -1,27 +1,18 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
import { Event_DetailMain } from "@/app_modules/event";
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const userLoginId : any= await funGetUserIdByToken();
const dataEvent = await event_getOneById(eventId);
const listPeserta = await Event_getListPesertaById(eventId);
const isJoin = await Event_CekUserJoinById(eventId, userLoginId);
const userLoginId = await newFunGetUserId();
const totalPeserta = await Event_countTotalPesertaById(eventId);
return (
<>
<Event_DetailMain
dataEvent={dataEvent as any}
listPeserta={listPeserta as any}
userLoginId={userLoginId as string}
isJoin={isJoin}
totalPeserta={totalPeserta as any}
eventId={eventId}
/>
</>
);