Fix: voting status

Deskripsi:
- Perubahan router status & riwayat
This commit is contained in:
2024-10-29 14:10:46 +08:00
parent 8f76067380
commit e5e36a3889
35 changed files with 455 additions and 281 deletions

View File

@@ -1,8 +1,10 @@
import { Event_DetailDraft } from "@/app_modules/event"
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"
import { Event_DetailDraft } from "@/app_modules/event";
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 dataEvent = await event_getOneById(eventId)
return <Event_DetailDraft dataEvent={dataEvent as any} />
let eventId = params.id;
const dataEvent = await event_getOneById(eventId);
return (
<Event_DetailDraft eventId={eventId as any} dataEvent={dataEvent as any} />
);
}

View File

@@ -1,7 +1,6 @@
import { Event_Edit } from "@/app_modules/event";
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
import _ from "lodash";
export default async function Page({ params }: { params: { id: string } }) {
@@ -15,7 +14,6 @@ export default async function Page({ params }: { params: { id: string } }) {
"updatedAt",
"active",
]);
// console.log(dataEvent)
const listTipeAcara = await Event_getMasterTipeAcara()

View File

@@ -1,10 +1,8 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Event_StatusPage } from "@/app_modules/event";
import {
event_getAllByStatusId,
event_getMasterStatus,
event_getAllByStatusId,
event_getMasterStatus,
} from "@/app_modules/event/fun";
import React from "react";
async function Page({ params }: { params: { id: string } }) {
let statusId = params.id;

View File

@@ -0,0 +1,41 @@
import { Vote_Riwayat } from "@/app_modules/vote";
import { vote_getAllListRiwayat } from "@/app_modules/vote/fun/get/get_all_list_riwayat";
import { Vote_getAllListRiwayatSaya as vote_getAllListRiwayatSaya } from "@/app_modules/vote/fun/get/get_all_list_riwayat_saya";
export default async function Page({ params }: { params: { id: string } }) {
let statusRiwayatId = params.id;
const listRiwayat = await vote_getAllListRiwayat({ page: 1 });
const listRiwayatSaya = await vote_getAllListRiwayatSaya({ page: 1 });
if (statusRiwayatId == "1") {
return (
<>
<Vote_Riwayat
riwayatId={statusRiwayatId}
listRiwayat={listRiwayat as any}
/>
</>
);
}
if (statusRiwayatId == "2") {
return (
<>
<Vote_Riwayat
riwayatId={statusRiwayatId}
listRiwayatSaya={listRiwayatSaya as any}
/>
</>
);
}
// return (
// <>
// <Vote_Riwayat
// riwayatId={statusRiwayatId}
// listRiwayat={listRiwayat as any}
// listRiwayatSaya={listRiwayatSaya as any}
// />
// </>
// );
}

View File

@@ -1,17 +0,0 @@
import { Vote_Riwayat } from "@/app_modules/vote";
import { vote_getAllListRiwayat } from "@/app_modules/vote/fun/get/get_all_list_riwayat";
import { Vote_getAllListRiwayatSaya as vote_getAllListRiwayatSaya } from "@/app_modules/vote/fun/get/get_all_list_riwayat_saya";
export default async function Page() {
const listRiwayat = await vote_getAllListRiwayat({ page: 1 });
const listRiwayatSaya = await vote_getAllListRiwayatSaya({ page: 1 });
return (
<>
<Vote_Riwayat
listRiwayat={listRiwayat as any}
listRiwayatSaya={listRiwayatSaya as any}
/>
</>
);
}

View File

@@ -0,0 +1,25 @@
import { Vote_Status } from "@/app_modules/vote";
import {
vote_funGetAllByStatusId,
voting_getMasterStatus,
} from "@/app_modules/vote/fun";
export default async function Page({ params }: { params: { id: string } }) {
const statusId = params.id;
const listStatus = await voting_getMasterStatus();
const dataVoting = await vote_funGetAllByStatusId({
page: 1,
statusId: statusId,
});
return (
<>
<Vote_Status
statusId={statusId}
dataVoting={dataVoting as any}
listStatus={listStatus as any}
/>
</>
);
}

View File

@@ -1,23 +0,0 @@
import { Vote_Status } from "@/app_modules/vote";
import { vote_getAllDraft } from "@/app_modules/vote/fun/get/status/get_all_draft";
import { vote_getAllPublish } from "@/app_modules/vote/fun/get/status/get_all_publish";
import { vote_getAllReject } from "@/app_modules/vote/fun/get/status/get_all_reject";
import { vote_getAllReview } from "@/app_modules/vote/fun/get/status/get_all_review";
export default async function Page() {
const listPublish = await vote_getAllPublish({page: 1});
const listReview = await vote_getAllReview({page: 1});
const listDraft = await vote_getAllDraft({page: 1});
const listReject = await vote_getAllReject({page: 1});
return (
<>
<Vote_Status
listPublish={listPublish as any}
listReview={listReview as any}
listDraft={listDraft as any}
listReject={listReject as any}
/>
</>
);
}