Merge pull request #116 from bipproduction/voting/fix-status
Voting/fix status
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "npx tsx prisma/seed.ts"
|
"seed": "npx tsx prisma/seed.ts"
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { Event_DetailDraft } from "@/app_modules/event"
|
import { Event_DetailDraft } from "@/app_modules/event";
|
||||||
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"
|
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let eventId = params.id
|
let eventId = params.id;
|
||||||
const dataEvent = await event_getOneById(eventId)
|
const dataEvent = await event_getOneById(eventId);
|
||||||
return <Event_DetailDraft dataEvent={dataEvent as any} />
|
return (
|
||||||
|
<Event_DetailDraft eventId={eventId as any} dataEvent={dataEvent as any} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Event_Edit } from "@/app_modules/event";
|
import { Event_Edit } from "@/app_modules/event";
|
||||||
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
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 { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
@@ -15,7 +14,6 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
"updatedAt",
|
"updatedAt",
|
||||||
"active",
|
"active",
|
||||||
]);
|
]);
|
||||||
// console.log(dataEvent)
|
|
||||||
|
|
||||||
const listTipeAcara = await Event_getMasterTipeAcara()
|
const listTipeAcara = await Event_getMasterTipeAcara()
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import { Event_StatusPage } from "@/app_modules/event";
|
import { Event_StatusPage } from "@/app_modules/event";
|
||||||
import {
|
import {
|
||||||
event_getAllByStatusId,
|
event_getAllByStatusId,
|
||||||
event_getMasterStatus,
|
event_getMasterStatus,
|
||||||
} from "@/app_modules/event/fun";
|
} from "@/app_modules/event/fun";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
async function Page({ params }: { params: { id: string } }) {
|
async function Page({ params }: { params: { id: string } }) {
|
||||||
let statusId = params.id;
|
let statusId = params.id;
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import { Event_StatusPage } from "@/app_modules/event";
|
|
||||||
import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft";
|
|
||||||
import { event_getAllReject } from "@/app_modules/event/fun/get/status/get_all_reject";
|
|
||||||
import { event_getAllReview } from "@/app_modules/event/fun/get/status/get_all_review";
|
|
||||||
import { event_funGetAllStatusPublish } from "@/app_modules/event/fun/get/status/get_all_status_publish";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
const listPublish = await event_funGetAllStatusPublish({ page: 1 });
|
|
||||||
const listReview = await event_getAllReview({ page: 1 });
|
|
||||||
const listDraft = await event_getAllDraft({ page: 1 });
|
|
||||||
const listReject = await event_getAllReject({ page: 1 });
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>maintenace</>
|
|
||||||
// <Event_StatusPage
|
|
||||||
// authorId={userLoginId}
|
|
||||||
// listPublish={listPublish}
|
|
||||||
// listReview={listReview}
|
|
||||||
// listDraft={listDraft}
|
|
||||||
// listReject={listReject}
|
|
||||||
// />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
41
src/app/dev/vote/main/riwayat/[id]/page.tsx
Normal file
41
src/app/dev/vote/main/riwayat/[id]/page.tsx
Normal 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}
|
||||||
|
// />
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
|
}
|
||||||
@@ -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}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
25
src/app/dev/vote/main/status/[id]/page.tsx
Normal file
25
src/app/dev/vote/main/status/[id]/page.tsx
Normal 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}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -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}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,15 @@ export const RouterVote = {
|
|||||||
// main
|
// main
|
||||||
splash: "/dev/vote/splash",
|
splash: "/dev/vote/splash",
|
||||||
beranda: "/dev/vote/main/beranda",
|
beranda: "/dev/vote/main/beranda",
|
||||||
status: "/dev/vote/main/status",
|
status: ({ id }: { id?: string }) => `/dev/vote/main/status/${id}`,
|
||||||
kontribusi: "/dev/vote/main/kontribusi",
|
kontribusi: "/dev/vote/main/kontribusi",
|
||||||
riwayat: "/dev/vote/main/riwayat",
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param riwayatId | 1 & 2 | 1: Semua, 2: Saya
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
riwayat: ({ id }: { id?: string }) => `/dev/vote/main/riwayat/${id}`,
|
||||||
|
|
||||||
// create
|
// create
|
||||||
create: "/dev/vote/create",
|
create: "/dev/vote/create",
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ async function onReject(
|
|||||||
|
|
||||||
const res = await AdminEvent_funEditCatatanById(data as any);
|
const res = await AdminEvent_funEditCatatanById(data as any);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
setSaveLoading(true);
|
||||||
const dataNotif = {
|
const dataNotif = {
|
||||||
appId: res.data?.id,
|
appId: res.data?.id,
|
||||||
status: res.data?.Voting_Status?.name as any,
|
status: res.data?.Voting_Status?.name as any,
|
||||||
@@ -358,7 +359,7 @@ async function onReject(
|
|||||||
|
|
||||||
await AdminVote_getListTableByStatusId("2").then((val) => {
|
await AdminVote_getListTableByStatusId("2").then((val) => {
|
||||||
setData(val);
|
setData(val);
|
||||||
setSaveLoading(true);
|
setSaveLoading(false);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
|
|||||||
3
src/app_modules/event/component/index.ts
Normal file
3
src/app_modules/event/component/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { Event_ComponentSkeletonDetailData } from "./skeleton/comp_skeleton_detail_data";
|
||||||
|
|
||||||
|
export { Event_ComponentSkeletonDetailData };
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||||
|
import { Stack, Title, Grid, Text, Center, Skeleton } from "@mantine/core";
|
||||||
|
import { data } from "autoprefixer";
|
||||||
|
|
||||||
|
export function Event_ComponentSkeletonDetailData() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ComponentGlobal_CardStyles marginBottom={"16px"}>
|
||||||
|
<Stack px={"sm"} spacing={"lg"}>
|
||||||
|
<Center>
|
||||||
|
<Skeleton radius={"xl"} h={20} />
|
||||||
|
</Center>
|
||||||
|
{Array.from(new Array(4)).map((e, i) => (
|
||||||
|
<Grid key={i}>
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<Skeleton radius={"xl"} h={20} />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={1}>:</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Skeleton radius={"xl"} h={20} />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<Stack spacing={"xs"}>
|
||||||
|
<Skeleton radius={"xl"} h={20} w={200} />
|
||||||
|
<Skeleton radius={"xl"} h={20} />
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</ComponentGlobal_CardStyles>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import { Button, Group, Stack } from "@mantine/core";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { Event_ComponentSkeletonDetailData } from "../../component";
|
||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||||
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
|
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
|
||||||
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
@@ -19,19 +20,29 @@ import { MODEL_EVENT } from "../../model/interface";
|
|||||||
|
|
||||||
export default function Event_DetailDraft({
|
export default function Event_DetailDraft({
|
||||||
dataEvent,
|
dataEvent,
|
||||||
|
eventId,
|
||||||
}: {
|
}: {
|
||||||
dataEvent: MODEL_EVENT;
|
dataEvent: MODEL_EVENT;
|
||||||
|
eventId: string;
|
||||||
}) {
|
}) {
|
||||||
const [data, setData] = useState(dataEvent);
|
const [data, setData] = useState<MODEL_EVENT | null>(dataEvent);
|
||||||
|
|
||||||
|
console.log(data, "ini data dipage");
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Event_ComponentSkeletonDetailData />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(dataEvent.tanggal)}</pre> */}
|
{/* <pre>{JSON.stringify(dataEvent.tanggal)}</pre> */}
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
{dataEvent?.catatan ? (
|
{data?.catatan ? (
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation isReport informasi={data?.catatan} />
|
||||||
isReport
|
|
||||||
informasi={dataEvent?.catatan}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -200,6 +200,7 @@ export default function Event_Edit({
|
|||||||
onClick={() => onUpdate(router, value, setLoading)}
|
onClick={() => onUpdate(router, value, setLoading)}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
@@ -216,13 +217,14 @@ async function onUpdate(
|
|||||||
if (_.values(value).includes(""))
|
if (_.values(value).includes(""))
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||||
|
|
||||||
await Event_funEditById(value).then((res) => {
|
const res = await Event_funEditById(value);
|
||||||
if (res.status === 200) {
|
setLoading(true);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
|
||||||
setLoading(true);
|
if (res.status === 200) {
|
||||||
router.back();
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
} else {
|
router.back();
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
setLoading(false);
|
||||||
}
|
} else {
|
||||||
});
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export async function Event_funEditById(data: MODEL_EVENT) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!updt) return { status: 400, message: "Update Gagal" };
|
if (!updt) return { status: 400, message: "Update Gagal" };
|
||||||
revalidatePath(RouterEvent.detail_draft + data.id);
|
revalidatePath(`/dev/event/detail/draft/`, "page");
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil Update",
|
message: "Berhasil Update",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function event_getOneById(eventId: string) {
|
export async function event_getOneById(eventId: string) {
|
||||||
const data = await prisma.event.findFirst({
|
const data = await prisma.event.findFirst({
|
||||||
@@ -31,5 +32,7 @@ export async function event_getOneById(eventId: string) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
revalidatePath("/dev/event/detail/draft/");
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,24 +15,50 @@ export async function event_getAllByStatusId({
|
|||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
const data = await prisma.event.findMany({
|
if (statusId == "1") {
|
||||||
take: takeData,
|
const data = await prisma.event.findMany({
|
||||||
skip: skipData,
|
take: takeData,
|
||||||
orderBy: {
|
skip: skipData,
|
||||||
updatedAt: "desc",
|
orderBy: {
|
||||||
},
|
updatedAt: "desc",
|
||||||
where: {
|
},
|
||||||
active: true,
|
where: {
|
||||||
eventMaster_StatusId: statusId,
|
active: true,
|
||||||
authorId: userLoginId,
|
eventMaster_StatusId: "1",
|
||||||
},
|
authorId: userLoginId,
|
||||||
select: {
|
tanggal: {
|
||||||
id: true,
|
gte: new Date(),
|
||||||
title: true,
|
},
|
||||||
deskripsi: true,
|
},
|
||||||
tanggal: true,
|
select: {
|
||||||
},
|
id: true,
|
||||||
});
|
title: true,
|
||||||
|
deskripsi: true,
|
||||||
|
tanggal: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
} else {
|
||||||
|
const data = await prisma.event.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
eventMaster_StatusId: statusId,
|
||||||
|
authorId: userLoginId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
deskripsi: true,
|
||||||
|
tanggal: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export default function Event_Riwayat({
|
|||||||
dataRiwayatSaya?: MODEL_EVENT[];
|
dataRiwayatSaya?: MODEL_EVENT[];
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_event_riwayat)
|
|
||||||
const [changeStatus, setChangeStatus] = useState(statusId);
|
const [changeStatus, setChangeStatus] = useState(statusId);
|
||||||
|
|
||||||
const listTabs = [
|
const listTabs = [
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default function Event_StatusPage({
|
|||||||
const [changeStatus, setChangeStatus] = useState(statusId);
|
const [changeStatus, setChangeStatus] = useState(statusId);
|
||||||
|
|
||||||
async function onChangeStatus({ statusId }: { statusId: string }) {
|
async function onChangeStatus({ statusId }: { statusId: string }) {
|
||||||
router.push(RouterEvent.status({ id: statusId }));
|
router.replace(RouterEvent.status({ id: statusId }));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -36,7 +36,6 @@ export default function Event_StatusPage({
|
|||||||
variant="pills"
|
variant="pills"
|
||||||
radius="xl"
|
radius="xl"
|
||||||
mt={1}
|
mt={1}
|
||||||
// defaultValue={"1"}
|
|
||||||
value={changeStatus}
|
value={changeStatus}
|
||||||
onTabChange={(val: any) => {
|
onTabChange={(val: any) => {
|
||||||
setChangeStatus(val);
|
setChangeStatus(val);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function redirectVotingPage({
|
|||||||
router: AppRouterInstance;
|
router: AppRouterInstance;
|
||||||
onSetPage: (val: any) => void;
|
onSetPage: (val: any) => void;
|
||||||
}) {
|
}) {
|
||||||
const path = RouterVote.status;
|
const path = RouterVote.status({ id: "" });
|
||||||
|
|
||||||
if (data.status === "Publish") {
|
if (data.status === "Publish") {
|
||||||
onSetPage({
|
onSetPage({
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti
|
|||||||
import { Badge, Card, Group, Stack, Text } from "@mantine/core";
|
import { Badge, Card, Group, Stack, Text } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { MODEL_VOTING } from "../model/interface";
|
import { MODEL_VOTING } from "../model/interface";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { ComponentGlobal_CardLoadingOverlay, ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||||
|
|
||||||
export default function ComponentVote_CardViewStatus({
|
export default function ComponentVote_CardViewStatus({
|
||||||
path,
|
path,
|
||||||
@@ -14,59 +16,53 @@ export default function ComponentVote_CardViewStatus({
|
|||||||
data?: MODEL_VOTING;
|
data?: MODEL_VOTING;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Card
|
<ComponentGlobal_CardStyles
|
||||||
p={30}
|
onClickHandler={() => {
|
||||||
mb={"lg"}
|
|
||||||
style={{
|
|
||||||
backgroundColor: AccentColor.darkblue,
|
|
||||||
borderRadius: "10px",
|
|
||||||
border: `2px solid ${AccentColor.blue}`,
|
|
||||||
color: "white",
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
if (data?.id === undefined) {
|
if (data?.id === undefined) {
|
||||||
ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
|
ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
|
||||||
} else {
|
} else {
|
||||||
|
setVisible(true);
|
||||||
router.push((path as string) + data?.id);
|
router.push((path as string) + data?.id);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Isi deskripsi */}
|
{/* Isi deskripsi */}
|
||||||
<Card.Section>
|
<Stack px={"xs"} align="center">
|
||||||
<Stack px={"xs"} align="center">
|
<Text fw={"bold"} lineClamp={1} align="center">
|
||||||
<Text fw={"bold"} lineClamp={1} align="center">
|
{data?.title}
|
||||||
{data?.title}
|
</Text>
|
||||||
</Text>
|
<Badge
|
||||||
<Badge
|
// size="md"
|
||||||
// size="md"
|
styles={{
|
||||||
styles={{
|
root: {
|
||||||
root: {
|
backgroundColor: AccentColor.blue,
|
||||||
backgroundColor: AccentColor.blue,
|
border: `1px solid ${AccentColor.skyblue}`,
|
||||||
border: `1px solid ${AccentColor.skyblue}`,
|
color: "white",
|
||||||
color: "white",
|
width: "80%",
|
||||||
width: "80%",
|
},
|
||||||
},
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<Group>
|
||||||
<Group>
|
<Text>
|
||||||
<Text>
|
{data?.awalVote.toLocaleDateString(["id-ID"], {
|
||||||
{data?.awalVote.toLocaleDateString(["id-ID"], {
|
dateStyle: "medium",
|
||||||
dateStyle: "medium",
|
})}
|
||||||
})}
|
</Text>
|
||||||
</Text>
|
<Text>-</Text>
|
||||||
<Text>-</Text>
|
<Text>
|
||||||
<Text>
|
{data?.akhirVote.toLocaleDateString(["id-ID"], {
|
||||||
{data?.akhirVote.toLocaleDateString(["id-ID"], {
|
dateStyle: "medium",
|
||||||
dateStyle: "medium",
|
})}
|
||||||
})}
|
</Text>
|
||||||
</Text>
|
</Group>
|
||||||
</Group>
|
</Badge>
|
||||||
</Badge>
|
</Stack>
|
||||||
</Stack>
|
{visible && <ComponentGlobal_CardLoadingOverlay />}
|
||||||
</Card.Section>
|
</ComponentGlobal_CardStyles>
|
||||||
</Card>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
@@ -24,17 +27,13 @@ import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.share
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Vote_funCreate } from "../fun/create/create_vote";
|
import { Vote_funCreate } from "../fun/create/create_vote";
|
||||||
import { gs_vote_hotMenu, gs_vote_status } from "../global_state";
|
import { gs_vote_hotMenu } from "../global_state";
|
||||||
import { MODEL_VOTING } from "../model/interface";
|
import { MODEL_VOTING } from "../model/interface";
|
||||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
|
||||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
|
||||||
|
|
||||||
export default function Vote_Create() {
|
export default function Vote_Create() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_vote_hotMenu);
|
const [hotMenu, setHotMenu] = useAtom(gs_vote_hotMenu);
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
|
||||||
|
|
||||||
const [data, setData] = useState({
|
const [data, setData] = useState({
|
||||||
title: "",
|
title: "",
|
||||||
@@ -209,14 +208,7 @@ export default function Vote_Create() {
|
|||||||
mt={"lg"}
|
mt={"lg"}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onSave(
|
onSave(router, setHotMenu, data as any, listVote, setIsLoading);
|
||||||
router,
|
|
||||||
setHotMenu,
|
|
||||||
setTabsStatus,
|
|
||||||
data as any,
|
|
||||||
listVote,
|
|
||||||
setIsLoading
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
c={"black"}
|
c={"black"}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
@@ -235,7 +227,6 @@ export default function Vote_Create() {
|
|||||||
async function onSave(
|
async function onSave(
|
||||||
router: AppRouterInstance,
|
router: AppRouterInstance,
|
||||||
setHotMenu: any,
|
setHotMenu: any,
|
||||||
setTabsStatus: any,
|
|
||||||
data: MODEL_VOTING,
|
data: MODEL_VOTING,
|
||||||
listVote: any[],
|
listVote: any[],
|
||||||
setIsLoading: any
|
setIsLoading: any
|
||||||
@@ -280,8 +271,7 @@ async function onSave(
|
|||||||
);
|
);
|
||||||
|
|
||||||
setHotMenu(2);
|
setHotMenu(2);
|
||||||
setTabsStatus("Review");
|
router.replace(RouterVote.status({ id: "2" }));
|
||||||
router.replace(RouterVote.status);
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,39 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||||
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import { Button, SimpleGrid, Stack } from "@mantine/core";
|
import { Button, SimpleGrid, Stack } from "@mantine/core";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
||||||
import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
||||||
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
import { gs_vote_status } from "../../global_state";
|
|
||||||
import { MODEL_VOTING } from "../../model/interface";
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
|
||||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
|
||||||
|
|
||||||
export default function Vote_DetailDraft({
|
export default function Vote_DetailDraft({
|
||||||
dataVote,
|
dataVote,
|
||||||
}: {
|
}: {
|
||||||
dataVote: MODEL_VOTING;
|
dataVote: MODEL_VOTING;
|
||||||
}) {
|
}) {
|
||||||
|
const [data, setData] = useState(dataVote);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
{dataVote?.catatan ? (
|
{dataVote?.catatan ? (
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation isReport informasi={data?.catatan} />
|
||||||
isReport
|
|
||||||
informasi={dataVote?.catatan}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
<ComponentVote_DetailDataSebelumPublish data={dataVote} />
|
<ComponentVote_DetailDataSebelumPublish data={data} />
|
||||||
<ButtonAction voteId={dataVote.id} awalVote={dataVote.awalVote} />
|
<ButtonAction voteId={data.id} awalVote={data.awalVote} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -50,7 +47,6 @@ function ButtonAction({
|
|||||||
awalVote: Date;
|
awalVote: Date;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
|
||||||
const [openModal1, setOpenModal1] = useState(false);
|
const [openModal1, setOpenModal1] = useState(false);
|
||||||
const [openModal2, setOpenModal2] = useState(false);
|
const [openModal2, setOpenModal2] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -84,10 +80,10 @@ function ButtonAction({
|
|||||||
count: 1,
|
count: 1,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
setTabsStatus("Review");
|
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
router.back();
|
router.replace(RouterVote.status({ id: "2" }));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
@@ -97,9 +93,9 @@ function ButtonAction({
|
|||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
await Vote_funDeleteById(voteId).then((res) => {
|
await Vote_funDeleteById(voteId).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setTabsStatus("Draft");
|
setOpenModal2(false);
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
||||||
router.back();
|
router.replace(RouterVote.status({ id: "3" }));
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,7 @@ import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_
|
|||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||||
import {
|
import { Button, SimpleGrid, Stack } from "@mantine/core";
|
||||||
Button,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -17,21 +13,21 @@ import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
|
|||||||
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
import { gs_vote_status } from "../../global_state";
|
import { gs_vote_status } from "../../global_state";
|
||||||
import { MODEL_VOTING } from "../../model/interface";
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
|
|
||||||
export default function Vote_DetailReject({
|
export default function Vote_DetailReject({
|
||||||
dataVote,
|
dataVote,
|
||||||
}: {
|
}: {
|
||||||
dataVote: MODEL_VOTING;
|
dataVote: MODEL_VOTING;
|
||||||
}) {
|
}) {
|
||||||
|
const [data, setData] = useState(dataVote);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation isReport informasi={data?.catatan} />
|
||||||
isReport
|
<ComponentVote_DetailDataSebelumPublish data={data as any} />
|
||||||
informasi={dataVote?.catatan}
|
<ButtonAction voteId={data.id} />
|
||||||
/>
|
|
||||||
<ComponentVote_DetailDataSebelumPublish data={dataVote as any} />
|
|
||||||
<ButtonAction voteId={dataVote.id} />
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -39,8 +35,6 @@ export default function Vote_DetailReject({
|
|||||||
|
|
||||||
function ButtonAction({ voteId }: { voteId: string }) {
|
function ButtonAction({ voteId }: { voteId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
|
||||||
|
|
||||||
const [openModal1, setOpenModal1] = useState(false);
|
const [openModal1, setOpenModal1] = useState(false);
|
||||||
const [openModal2, setOpenModal2] = useState(false);
|
const [openModal2, setOpenModal2] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -48,9 +42,9 @@ function ButtonAction({ voteId }: { voteId: string }) {
|
|||||||
async function onUpdate() {
|
async function onUpdate() {
|
||||||
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
|
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setTabsStatus("Draft");
|
setIsLoading(true);
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Masuk Draft", 2000);
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Masuk Draft", 2000);
|
||||||
router.back();
|
router.replace(RouterVote.status({ id: "3" }));
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
@@ -60,9 +54,9 @@ function ButtonAction({ voteId }: { voteId: string }) {
|
|||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
await Vote_funDeleteById(voteId).then((res) => {
|
await Vote_funDeleteById(voteId).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setTabsStatus("Draft");
|
setOpenModal2(false);
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
|
||||||
router.back();
|
router.replace(RouterVote.status({ id: "4" }));
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||||
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import { Button, Stack } from "@mantine/core";
|
import { Button, Stack } from "@mantine/core";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
|
||||||
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
import { gs_vote_status } from "../../global_state";
|
|
||||||
import { MODEL_VOTING } from "../../model/interface";
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
|
||||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
|
||||||
|
|
||||||
export default function Vote_DetailReview({
|
export default function Vote_DetailReview({
|
||||||
dataVote,
|
dataVote,
|
||||||
@@ -32,7 +31,6 @@ export default function Vote_DetailReview({
|
|||||||
function ButtonAction({ voteId }: { voteId: string }) {
|
function ButtonAction({ voteId }: { voteId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
|
||||||
const [openModal, setOpenModal] = useState(false);
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
|
||||||
async function onUpdate() {
|
async function onUpdate() {
|
||||||
@@ -58,9 +56,9 @@ function ButtonAction({ voteId }: { voteId: string }) {
|
|||||||
count: 1,
|
count: 1,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
setTabsStatus("Draft");
|
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil Batalkan Review", 2000);
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Batalkan Review", 2000);
|
||||||
router.back();
|
router.replace(RouterVote.status({ id: "3" }));
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -4,21 +4,33 @@ import prisma from "@/app/lib/prisma";
|
|||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param voteId
|
* @param votingId
|
||||||
* @returns isActive berubah menjadi false
|
|
||||||
*/
|
*/
|
||||||
export async function Vote_funDeleteById(voteId: string) {
|
export async function Vote_funDeleteById(votingId: string) {
|
||||||
const del = await prisma.voting.update({
|
const del = await prisma.voting.delete({
|
||||||
where: {
|
where: {
|
||||||
id: voteId,
|
id: votingId,
|
||||||
},
|
},
|
||||||
data: {
|
select: {
|
||||||
isActive: false,
|
Voting_DaftarNamaVote: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!del) return { status: 400, message: "Gagal Hapus Data" };
|
if (!del) return { status: 400, message: "Gagal Hapus Data" };
|
||||||
revalidatePath("/dev/vote/main/status");
|
|
||||||
|
for (let i of del.Voting_DaftarNamaVote) {
|
||||||
|
const hapusDaftarPilihan = await prisma.voting_DaftarNamaVote.delete({
|
||||||
|
where: {
|
||||||
|
id: i.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!hapusDaftarPilihan)
|
||||||
|
return { status: 400, message: "Gagal Hapus Daftar Pilihan" };
|
||||||
|
}
|
||||||
|
|
||||||
|
revalidatePath("/dev/vote/main/status/3");
|
||||||
|
revalidatePath("/dev/vote/main/status/4");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Hapus Berhasil",
|
message: "Hapus Berhasil",
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export async function Vote_funEditById(
|
|||||||
if (!namaPilihan) return { status: 400, message: "Gagal Membuat List" };
|
if (!namaPilihan) return { status: 400, message: "Gagal Membuat List" };
|
||||||
}
|
}
|
||||||
|
|
||||||
revalidatePath("/dev/vote/detail/draft");
|
revalidatePath(`/dev/vote/detail/draft`);
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil Update",
|
message: "Berhasil Update",
|
||||||
|
|||||||
9
src/app_modules/vote/fun/get/get_list_status_voting.ts
Normal file
9
src/app_modules/vote/fun/get/get_list_status_voting.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import { prisma } from "@/app/lib";
|
||||||
|
|
||||||
|
export async function voting_getMasterStatus() {
|
||||||
|
const data = await prisma.voting_Status.findMany({});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
59
src/app_modules/vote/fun/get/status/get_all_by_status_id.ts
Normal file
59
src/app_modules/vote/fun/get/status/get_all_by_status_id.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import { prisma } from "@/app/lib";
|
||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
|
export async function vote_funGetAllByStatusId({
|
||||||
|
page,
|
||||||
|
statusId,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
statusId: string;
|
||||||
|
}) {
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
if (statusId == "1") {
|
||||||
|
const data = await prisma.voting.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
voting_StatusId: "1",
|
||||||
|
authorId: userLoginId,
|
||||||
|
isActive: true,
|
||||||
|
akhirVote: {
|
||||||
|
gte: new Date(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Voting_DaftarNamaVote: {
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "asc",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
} else {
|
||||||
|
const data = await prisma.voting.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
voting_StatusId: statusId,
|
||||||
|
authorId: userLoginId,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
import { voting_funUpdateIsArsipById } from "./edit/fun_update_is_arsip_by_id";
|
import { voting_funUpdateIsArsipById } from "./edit/fun_update_is_arsip_by_id";
|
||||||
|
import { voting_getMasterStatus } from "./get/get_list_status_voting";
|
||||||
|
import { vote_funGetAllByStatusId } from "./get/status/get_all_by_status_id";
|
||||||
|
|
||||||
export { voting_funUpdateIsArsipById };
|
export { voting_funUpdateIsArsipById };
|
||||||
|
export { vote_funGetAllByStatusId };
|
||||||
|
export { voting_getMasterStatus };
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default function LayoutVote_Main({
|
|||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: "Status",
|
name: "Status",
|
||||||
path: RouterVote.status,
|
path: RouterVote.status({ id: "1" }),
|
||||||
icon: <IconReservedLine />,
|
icon: <IconReservedLine />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@ export default function LayoutVote_Main({
|
|||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: "Riwayat",
|
name: "Riwayat",
|
||||||
path: RouterVote.riwayat,
|
path: RouterVote.riwayat({ id: "1" }),
|
||||||
icon: <IconHistory />,
|
icon: <IconHistory />,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -91,7 +91,6 @@ export default function LayoutVote_Main({
|
|||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
</UIGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -7,40 +7,53 @@ import Vote_RiwayatSaya from "./saya";
|
|||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_vote_riwayat } from "../../global_state";
|
import { gs_vote_riwayat } from "../../global_state";
|
||||||
import { MODEL_VOTING } from "../../model/interface";
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
|
|
||||||
export default function Vote_Riwayat({
|
export default function Vote_Riwayat({
|
||||||
|
riwayatId,
|
||||||
listRiwayat,
|
listRiwayat,
|
||||||
listRiwayatSaya,
|
listRiwayatSaya,
|
||||||
}: {
|
}: {
|
||||||
listRiwayat: MODEL_VOTING[];
|
riwayatId: string;
|
||||||
listRiwayatSaya: MODEL_VOTING[];
|
listRiwayat?: MODEL_VOTING[];
|
||||||
|
listRiwayatSaya?: MODEL_VOTING[];
|
||||||
}) {
|
}) {
|
||||||
const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_vote_riwayat);
|
const router = useRouter();
|
||||||
|
const [changeStatus, setChangeStatus] = useState(riwayatId);
|
||||||
|
|
||||||
const listTabs = [
|
const listTabs = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: "1",
|
||||||
path: <Vote_SemuaRiwayat listRiwayat={listRiwayat} />,
|
|
||||||
value: "Semua",
|
value: "Semua",
|
||||||
label: "Semua Riwayat",
|
label: "Semua Riwayat",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: "2",
|
||||||
path: <Vote_RiwayatSaya listRiwayatSaya={listRiwayatSaya} />,
|
|
||||||
value: "Saya",
|
value: "Saya",
|
||||||
label: "Riwayat Saya",
|
label: "Riwayat Saya",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
async function onChangeStatus({ statusId }: { statusId: string }) {
|
||||||
|
router.push(RouterVote.riwayat({ id: statusId }));
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tabs
|
<Tabs
|
||||||
mt={1}
|
mt={1}
|
||||||
variant="pills"
|
variant="pills"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
defaultValue={"Semua"}
|
value={changeStatus}
|
||||||
value={tabsRiwayat}
|
onTabChange={(val: any) => {
|
||||||
onTabChange={setTabsRiwayat}
|
setChangeStatus(val);
|
||||||
|
onChangeStatus({ statusId: val });
|
||||||
|
}}
|
||||||
styles={{
|
styles={{
|
||||||
tabsList: {
|
tabsList: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
@@ -58,15 +71,15 @@ export default function Vote_Riwayat({
|
|||||||
{listTabs.map((e, i) => (
|
{listTabs.map((e, i) => (
|
||||||
<Tabs.Tab
|
<Tabs.Tab
|
||||||
key={i}
|
key={i}
|
||||||
value={e.value}
|
value={e.id}
|
||||||
fw={"bold"}
|
fw={"bold"}
|
||||||
c={"black"}
|
c={"black"}
|
||||||
style={{
|
style={{
|
||||||
transition: "0.5s",
|
transition: "0.5s",
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
tabsRiwayat === e.value ? MainColor.yellow : "white",
|
changeStatus === e.id ? MainColor.yellow : "white",
|
||||||
border:
|
border:
|
||||||
tabsRiwayat === e.value
|
changeStatus === e.id
|
||||||
? `1px solid ${AccentColor.yellow}`
|
? `1px solid ${AccentColor.yellow}`
|
||||||
: `1px solid white`,
|
: `1px solid white`,
|
||||||
}}
|
}}
|
||||||
@@ -75,11 +88,14 @@ export default function Vote_Riwayat({
|
|||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
))}
|
))}
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
{listTabs.map((e) => (
|
|
||||||
<Tabs.Panel key={e.id} value={e.value}>
|
{riwayatId === "1" && (
|
||||||
{e.path}
|
<Vote_SemuaRiwayat listRiwayat={listRiwayat as any} />
|
||||||
</Tabs.Panel>
|
)}
|
||||||
))}
|
|
||||||
|
{riwayatId === "2" && (
|
||||||
|
<Vote_RiwayatSaya listRiwayatSaya={listRiwayatSaya as any} />
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function Vote_RiwayatSaya({
|
|||||||
// --- Main component --- //
|
// --- Main component --- //
|
||||||
<Box>
|
<Box>
|
||||||
<ScrollOnly
|
<ScrollOnly
|
||||||
height="75vh"
|
height="76vh"
|
||||||
renderLoading={() => (
|
renderLoading={() => (
|
||||||
<Center mt={"lg"}>
|
<Center mt={"lg"}>
|
||||||
<Loader color={"yellow"} />
|
<Loader color={"yellow"} />
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default function Vote_SemuaRiwayat({
|
|||||||
// --- Main component --- //
|
// --- Main component --- //
|
||||||
<Box>
|
<Box>
|
||||||
<ScrollOnly
|
<ScrollOnly
|
||||||
height="75vh"
|
height="76vh"
|
||||||
renderLoading={() => (
|
renderLoading={() => (
|
||||||
<Center mt={"lg"}>
|
<Center mt={"lg"}>
|
||||||
<Loader color={"yellow"} />
|
<Loader color={"yellow"} />
|
||||||
|
|||||||
@@ -1,51 +1,36 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
import {
|
import {
|
||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import { Stack, Tabs } from "@mantine/core";
|
import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
|
||||||
import { useAtom } from "jotai";
|
import { Box, Stack, Tabs } from "@mantine/core";
|
||||||
import { gs_vote_status } from "../../global_state";
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
import Vote_StatusDraft from "./draft";
|
import Vote_StatusDraft from "./draft";
|
||||||
import Vote_StatusPublish from "./publish";
|
import Vote_StatusPublish from "./publish";
|
||||||
import Vote_StatusReject from "./reject";
|
import Vote_StatusReject from "./reject";
|
||||||
import Vote_StatusReview from "./review";
|
import Vote_StatusReview from "./review";
|
||||||
|
|
||||||
export default function Vote_Status({
|
export default function Vote_Status({
|
||||||
listPublish,
|
statusId,
|
||||||
listReview,
|
dataVoting,
|
||||||
listDraft,
|
listStatus,
|
||||||
listReject,
|
|
||||||
}: {
|
}: {
|
||||||
listPublish: any[];
|
statusId: string;
|
||||||
listReview: any[];
|
dataVoting: MODEL_VOTING[];
|
||||||
listDraft: any[];
|
listStatus: MODEL_NEW_DEFAULT_MASTER[];
|
||||||
listReject: any[];
|
|
||||||
}) {
|
}) {
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_vote_status);
|
|
||||||
const listTabs = [
|
const router = useRouter();
|
||||||
{
|
const [changeStatus, setChangeStatus] = useState(statusId);
|
||||||
id: 1,
|
|
||||||
path: <Vote_StatusPublish listPublish={listPublish} />,
|
async function onChangeStatus({ statusId }: { statusId: string }) {
|
||||||
value: "Publish",
|
router.replace(RouterVote.status({ id: statusId }));
|
||||||
},
|
}
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
path: <Vote_StatusReview listReview={listReview} />,
|
|
||||||
value: "Review",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
path: <Vote_StatusDraft listDraft={listDraft} />,
|
|
||||||
value: "Draft",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
path: <Vote_StatusReject listReject={listReject} />,
|
|
||||||
value: "Reject",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -53,9 +38,11 @@ export default function Vote_Status({
|
|||||||
mt={1}
|
mt={1}
|
||||||
variant="pills"
|
variant="pills"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
defaultValue={"Publish"}
|
value={changeStatus}
|
||||||
value={tabsStatus}
|
onTabChange={(val: any) => {
|
||||||
onTabChange={setTabsStatus}
|
setChangeStatus(val);
|
||||||
|
onChangeStatus({ statusId: val });
|
||||||
|
}}
|
||||||
styles={{
|
styles={{
|
||||||
tabsList: {
|
tabsList: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
@@ -70,28 +57,36 @@ export default function Vote_Status({
|
|||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Tabs.List grow>
|
<Tabs.List grow>
|
||||||
{listTabs.map((e) => (
|
{listStatus.map((e) => (
|
||||||
<Tabs.Tab
|
<Tabs.Tab
|
||||||
w={"20%"}
|
w={"20%"}
|
||||||
key={e.id}
|
key={e.id}
|
||||||
value={e.value}
|
value={e.id}
|
||||||
fw={"bold"}
|
fw={"bold"}
|
||||||
c={"black"}
|
c={"black"}
|
||||||
style={{
|
style={{
|
||||||
transition: "0.5s",
|
transition: "0.5s",
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
tabsStatus === e.value ? MainColor.yellow : "white",
|
changeStatus === e.id ? MainColor.yellow : "white",
|
||||||
|
border:
|
||||||
|
changeStatus === e.id
|
||||||
|
? `1px solid ${AccentColor.yellow}`
|
||||||
|
: `1px solid white`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{e.value}
|
{e.name}
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
))}
|
))}
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
{listTabs.map((e) => (
|
|
||||||
<Tabs.Panel key={e.id} value={e.value}>
|
<Box>
|
||||||
{e.path}
|
{statusId === "1" && (
|
||||||
</Tabs.Panel>
|
<Vote_StatusPublish listPublish={dataVoting} />
|
||||||
))}
|
)}
|
||||||
|
{statusId === "2" && <Vote_StatusReview listReview={dataVoting} />}
|
||||||
|
{statusId === "3" && <Vote_StatusDraft listDraft={dataVoting} />}
|
||||||
|
{statusId === "4" && <Vote_StatusReject listReject={dataVoting} />}
|
||||||
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||||
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
|
||||||
import { MODEL_VOTING } from "../../model/interface";
|
|
||||||
import { Box, Center, Loader, Stack, Text } from "@mantine/core";
|
|
||||||
import _ from "lodash";
|
|
||||||
import ComponentVote_IsEmptyData from "../../component/is_empty_data";
|
|
||||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import job_getAllStatusPublish from "@/app_modules/job/fun/get/status/get_list_publish";
|
import { Box, Center, Loader } from "@mantine/core";
|
||||||
|
import _ from "lodash";
|
||||||
import { ScrollOnly } from "next-scroll-loader";
|
import { ScrollOnly } from "next-scroll-loader";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentVote_CardViewPublish from "../../component/card_view_publish";
|
import ComponentVote_CardViewStatus from "../../component/card_view_status";
|
||||||
import { vote_getAllReview } from "../../fun/get/status/get_all_review";
|
import { vote_getAllReview } from "../../fun/get/status/get_all_review";
|
||||||
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
|
|
||||||
export default function Vote_StatusReview({
|
export default function Vote_StatusReview({
|
||||||
listReview,
|
listReview,
|
||||||
|
|||||||
Reference in New Issue
Block a user