Fix voting

Deksripsi:
- Fix user server to API di tampilan utama voting
This commit is contained in:
2024-12-27 11:04:55 +08:00
parent 5f8a1c38d0
commit 924e994236
34 changed files with 1039 additions and 468 deletions

View File

@@ -1,9 +1,9 @@
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
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 newFunGetUserId();
const userLoginId = await funGetUserIdByToken();
const listTipeAcara = await Event_getMasterTipeAcara();
return (

View File

@@ -1,10 +1,10 @@
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Event_DetailMain } from "@/app_modules/event";
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const userLoginId = await newFunGetUserId();
const userLoginId = await funGetUserIdByToken();
const totalPeserta = await Event_countTotalPesertaById(eventId);
return (

View File

@@ -1,4 +1,4 @@
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import Ui_Konfirmasi from "@/app_modules/event/_ui/konfirmasi";
export default async function Page({
@@ -7,7 +7,7 @@ export default async function Page({
params: Promise<{ id: string }>;
}) {
const eventId = (await params).id;
const userLoginId = await newFunGetUserId();
const userLoginId = await funGetUserIdByToken();
return (
<>

View File

@@ -1,5 +1,5 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { RealtimeProvider } from "../lib";
import { newFunGetUserId } from "../lib/new_fun_user_id";
import { ServerEnv } from "../lib/server_env";
export default async function Layout({
@@ -8,7 +8,7 @@ export default async function Layout({
children: React.ReactNode;
}) {
const userId = await newFunGetUserId();
const userId = await funGetUserIdByToken();
return (
<>

View File

@@ -1,12 +1,10 @@
import { Vote_Beranda } from "@/app_modules/vote";
import { vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish";
export default async function Page() {
const dataVote = await vote_getAllListPublish({ page: 1 });
return (
<>
<Vote_Beranda dataVote={dataVote as any} />
<Vote_Beranda />
</>
);
}

View File

@@ -1,11 +1,9 @@
import { Vote_Kontribusi } from "@/app_modules/vote";
import { vote_getAllListKontribusiByAuthorId } from "@/app_modules/vote/fun/get/get_list_kontribusi_by_author_id";
export default async function Page() {
const dataKontribusi = await vote_getAllListKontribusiByAuthorId({ page: 1 });
return (
<>
<Vote_Kontribusi dataKontribusi={dataKontribusi as any} />
<Vote_Kontribusi />
</>
);
}

View File

@@ -1,41 +1,9 @@
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}
// />
// </>
// );
return (
<>
<Vote_Riwayat />
</>
);
}

View File

@@ -1,25 +1,9 @@
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,
});
export default async function Page() {
return (
<>
<Vote_Status
statusId={statusId}
dataVoting={dataVoting as any}
listStatus={listStatus as any}
/>
<Vote_Status />
</>
);
}