Fix event

Deskripsi:
- Fix logika konfirmasi event
- Penambahan tampilan kehadiran peserta di admin
This commit is contained in:
2024-12-09 13:57:40 +08:00
parent 667d90bdad
commit a308f41eb1
8 changed files with 196 additions and 96 deletions

View File

@@ -2,6 +2,7 @@
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
import {
Badge,
Button,
Center,
Pagination,
@@ -26,6 +27,7 @@ export function AdminEvent_ViewDetailPeserta({
const [isNPage, setNPage] = useState(dataPeserta.nPage);
const [isActivePage, setActivePage] = useState(1);
async function onPageClick(p: any) {
setActivePage(p);
const loadData = await adminEvent_getListPesertaById({
@@ -52,6 +54,15 @@ export function AdminEvent_ViewDetailPeserta({
<td>
<Center>{e?.User?.Profile?.email}</Center>
</td>
<td>
<Center>
{e.isPresent ? (
<Badge color="green">Hadir</Badge>
) : (
<Badge color="red">Tidak Hadir</Badge>
)}
</Center>
</td>
</tr>
));
@@ -81,6 +92,9 @@ export function AdminEvent_ViewDetailPeserta({
<th>
<Center>Email</Center>
</th>
<th>
<Center>Konfirmasi Kehadiran</Center>
</th>
</tr>
</thead>
<tbody>{tableRow}</tbody>

View File

@@ -22,6 +22,7 @@ export async function adminEvent_getListPesertaById({
eventId: eventId,
},
select: {
isPresent: true,
User: {
include: {
Profile: true,