# Event Join

## feat
- Join event
- History semua event dan event saya
### No Issuue
This commit is contained in:
2024-01-31 10:48:20 +08:00
parent ca9214d9e0
commit c01906c063
40 changed files with 682 additions and 98 deletions

1
src/app/admin/layout.tsx Normal file
View File

@@ -0,0 +1 @@
#! apa

View File

@@ -1,11 +1,14 @@
import { AdminEvent_Main } from "@/app_modules/admin/event";
import AdminEvent_funCountByStatusId from "@/app_modules/admin/event/fun/count/fun_count_event_by_status_id";
import { AdminEvent_funCountTipeAcara } from "@/app_modules/admin/event/fun/count/fun_count_tipe_acara";
export default async function Page() {
const countPublish = await AdminEvent_funCountByStatusId("1");
const countReview = await AdminEvent_funCountByStatusId("2");
const countDraft = await AdminEvent_funCountByStatusId("3");
const countReject = await AdminEvent_funCountByStatusId("4");
const countTipeAcara = await AdminEvent_funCountTipeAcara()
return (
<>
@@ -14,6 +17,7 @@ export default async function Page() {
countReview={countReview as number}
countDraft={countDraft as number}
countReject={countReject as number}
countTipeAcara={countTipeAcara as number}
/>
</>
);

View File

@@ -0,0 +1,14 @@
import { LayoutEvent_DetailRiwayat } from "@/app_modules/event";
import React from "react";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<LayoutEvent_DetailRiwayat>{children}</LayoutEvent_DetailRiwayat>
</>
);
}

View File

@@ -0,0 +1,24 @@
import { Event_DetailRiwayat } 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";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const dataEvent = await Event_getOneById(eventId);
const listPeserta = await Event_getListPesertaById(eventId);
const totalPeserta = await Event_countTotalPesertaById(eventId);
return (
<>
<Event_DetailRiwayat
dataEvent={dataEvent as any}
listPeserta={listPeserta as any}
totalPeserta={totalPeserta as any}
/>
</>
);
}

View File

@@ -1,7 +0,0 @@
import { Event_History } from "@/app_modules/event";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
console.log(eventId);
return <Event_History />;
}

View File

@@ -0,0 +1,19 @@
import { Event_Riwayat } from "@/app_modules/event";
import { Event_getListRiwayatSaya } from "@/app_modules/event/fun/get/get_list_riwayat_saya";
import { Event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/get_list_semua_riwayat";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const authorId = await User_getUserId();
const dataSemuaRiwayat = await Event_getListSemuaRiwayat();
const dataRiwayatSaya = await Event_getListRiwayatSaya(authorId);
return (
<Event_Riwayat
dataSemuaRiwayat={dataSemuaRiwayat as any}
dataRiwayatSaya={dataRiwayatSaya as any}
/>
);
}

View File

@@ -11,6 +11,7 @@ export default async function Page() {
return (
<Event_StatusPage
authorId={authorId}
listPublish={listPublish}
listReview={listReview}
listDraft={listDraft}

View File

@@ -4,7 +4,7 @@ export const RouterEvent = {
beranda: "/dev/event/main/beranda",
status_page: "/dev/event/main/status_page",
kontribusi: "/dev/event/main/kontribusi",
history: "/dev/event/main/history",
riwayat: "/dev/event/main/riwayat",
// status
status_publish: "/dev/event/main/status_page/publish",
@@ -25,4 +25,5 @@ export const RouterEvent = {
detail_review: "/dev/event/detail/review/",
detail_draft: "/dev/event/detail/draft/",
detail_reject: "/dev/event/detail/reject/",
detail_riwayat: "/dev/event/detail/riwayat/",
};