Fix voting, intergarsi ke API
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import { Voting_UiDetailKontributorVoting } from "@/app_modules/vote/_ui";
|
||||
import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const votingId = params.id;
|
||||
const listKontributor = await Vote_getListKontributorById(votingId);
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Voting_UiDetailKontributorVoting listKontributor={listKontributor} />
|
||||
<Voting_UiDetailKontributorVoting />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,29 +1,12 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { Vote_MainDetail } from "@/app_modules/vote";
|
||||
import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id";
|
||||
import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
|
||||
import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id";
|
||||
import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
|
||||
import { Vote_getOnePilihanVotingByUserId } from "@/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const voteId = params.id;
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const dataVote = await voting_funGetOneVotingbyId(voteId);
|
||||
const hasilVoting = await Vote_getHasilVoteById(voteId as any);
|
||||
const isKontributor = await Vote_cekKontributorById(voteId);
|
||||
const pilihanKontributor = await Vote_getOnePilihanVotingByUserId(voteId);
|
||||
const listKontributor = await Vote_getListKontributorById(voteId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Vote_MainDetail
|
||||
dataVote={dataVote as any}
|
||||
hasilVoting={hasilVoting}
|
||||
isKontributor={isKontributor}
|
||||
pilihanKontributor={pilihanKontributor as any}
|
||||
listKontributor={listKontributor as any}
|
||||
userLoginId={userLoginId as string}
|
||||
/>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user