Fix event
Deskripsi: - Fix konfirmasi - Fix qr code
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
|
||||
import { Event_Create } from "@/app_modules/event";
|
||||
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
|
||||
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const userLoginId = await newFunGetUserId();
|
||||
const listTipeAcara = await Event_getMasterTipeAcara();
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,33 +1,35 @@
|
||||
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_funCheckPesertaByUserId } from "@/app_modules/event/fun";
|
||||
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
import moment from "moment";
|
||||
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);
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const eventId = (await params).id;
|
||||
|
||||
const checkPeserta = await event_funCheckPesertaByUserId({
|
||||
eventId: eventId,
|
||||
userId: userLoginId as string,
|
||||
});
|
||||
|
||||
if (dataEvent == null) return redirect("/dev/event/main/beranda");
|
||||
// const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
if (moment(dataEvent?.tanggal).diff(moment(), "minutes") > 0)
|
||||
return redirect("/dev/event/main/beranda");
|
||||
// const checkPeserta = await event_funCheckPesertaByUserId({
|
||||
// eventId: eventId,
|
||||
// userId: userLoginId as string,
|
||||
// });
|
||||
|
||||
if (dataEvent?.isArsip)
|
||||
return redirect(`/dev/event/detail/riwayat/${dataEvent.id}`);
|
||||
// if (dataEvent == null) return redirect("/dev/event/main/beranda");
|
||||
|
||||
if (checkPeserta == false)
|
||||
return redirect(`/dev/event/detail/main/${eventId}`);
|
||||
// if (moment(dataEvent?.tanggal).diff(moment(), "minutes") > 0)
|
||||
// return redirect("/dev/event/main/beranda");
|
||||
|
||||
// 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`);
|
||||
@@ -35,10 +37,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Ui_Konfirmasi
|
||||
dataEvent={dataEvent as any}
|
||||
userLoginId={userLoginId as string}
|
||||
/>
|
||||
<Ui_Konfirmasi userLoginId={"" as string} eventId={eventId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Event_Beranda } from "@/app_modules/event";
|
||||
import { event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish";
|
||||
|
||||
export default async function Page() {
|
||||
const dataEvent = await event_getListAllPublish({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
<Event_Beranda dataEvent={dataEvent as any} />
|
||||
<Event_Beranda />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user