diff --git a/.gitignore b/.gitignore
index 8fbb7710..61b4bc33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,3 +37,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
+
+certificates
\ No newline at end of file
diff --git a/gen_api.ts b/gen_api.ts
deleted file mode 100644
index 82d5f284..00000000
--- a/gen_api.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-import app_config from "@/util/app_config";
-
- export const gen_api = {
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/test-scroll/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/test-scroll/route.ts)
- */
-testScroll : async ({isServer}: {isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/test-scroll/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/seeder/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/seeder/route.ts)
- */
-seeder : async ({isServer}: {isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/seeder/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_foto/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_foto/[url]/route.ts)
- */
-profileUrl_fotoUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/profile/url_foto/${url}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_background/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/url_background/[url]/route.ts)
- */
-profileUrl_backgroundUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/profile/url_background/${url}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/foto/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/foto/[id]/route.ts)
- */
-profileFotoIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/profile/foto/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/background/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/profile/background/[id]/route.ts)
- */
-profileBackgroundIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/profile/background/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/portofolio/logo/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/portofolio/logo/[id]/route.ts)
- */
-portofolioLogoIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/portofolio/logo/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/job/gambar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/job/gambar/[id]/route.ts)
- */
-jobGambarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/job/gambar/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/prospektus/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/prospektus/[id]/route.ts)
- */
-investasiProspektusIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/investasi/prospektus/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/midtrans/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/midtrans/[id]/route.ts)
- */
-investasiMidtransIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/investasi/midtrans/${id}/`, { method: 'POST', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/gambar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/gambar/[id]/route.ts)
- */
-investasiGambarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/investasi/gambar/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/dokumen/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/investasi/dokumen/[id]/route.ts)
- */
-investasiDokumenIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/investasi/dokumen/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image_cerita/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image_cerita/[url]/route.ts)
- */
-donasiImage_ceritaUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/image_cerita/${url}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image/[url]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/image/[url]/route.ts)
- */
-donasiImageUrlByUrl : async ({url, isServer}: {url: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/image/${url}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_pencairan/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_pencairan/[id]/route.ts)
- */
-donasiGambar_pencairanIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_pencairan/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_kabar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_kabar/[id]/route.ts)
- */
-donasiGambar_kabarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_kabar/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_cerita/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_cerita/[id]/route.ts)
- */
-donasiGambar_ceritaIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_cerita/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts)
- */
-donasiGambar_bukti_transferIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_bukti_transfer/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar/[id]/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/donasi/gambar/[id]/route.ts)
- */
-donasiGambarIdById : async ({id, isServer}: {id: string, isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar/${id}/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/validasi/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/validasi/route.ts)
- */
-authValidasi : async ({isServer}: {isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/auth/validasi/`, { method: 'POST', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/register/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/register/route.ts)
- */
-authRegister : async ({isServer}: {isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/auth/register/`, { method: 'POST', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/logout/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/logout/route.ts)
- */
-authLogout : async ({isServer}: {isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/auth/logout/`, { method: 'GET', cache: 'no-cache' })
- .then(res => res.json());
-}
-,
-/**
- * [/Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/login/route.ts](file:///Users/bagasbanuna/Documents/BIP/hipmi/src/app/api/auth/login/route.ts)
- */
-authLogin : async ({isServer}: {isServer?: boolean}) => {
-
- return fetch(`${isServer && app_config.host || ''}/api/auth/login/`, { method: 'POST', cache: 'no-cache' })
- .then(res => res.json());
-}
-};
\ No newline at end of file
diff --git a/package.json b/package.json
index 434b142a..5b8bc141 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,12 @@
{
"name": "hipmi",
- "version": "1.0.6",
+ "version": "1.1.0",
"private": true,
"prisma": {
"seed": "npx tsx prisma/seed.ts"
},
"scripts": {
- "dev": "next dev ",
+ "dev": "next dev --experimental-https",
"build": "next build",
"start": "next start",
"lint": "next lint"
diff --git a/src/app/dev/admin/award/main/page.tsx b/src/app/dev/admin/award/main/page.tsx
index 3c270cb2..6f07e7f7 100644
--- a/src/app/dev/admin/award/main/page.tsx
+++ b/src/app/dev/admin/award/main/page.tsx
@@ -1,5 +1,4 @@
import { Admin_Award } from "@/app_modules/admin/award";
-import { gen_api } from "../../../../../../gen_api";
export default async function Page() {
diff --git a/src/app/dev/event/main/riwayat/[id]/page.tsx b/src/app/dev/event/main/riwayat/[id]/page.tsx
new file mode 100644
index 00000000..024aa414
--- /dev/null
+++ b/src/app/dev/event/main/riwayat/[id]/page.tsx
@@ -0,0 +1,32 @@
+import { Event_Riwayat } from "@/app_modules/event";
+import { event_getListRiwayatSaya } from "@/app_modules/event/fun/get/riwayat/get_list_riwayat_saya";
+import { event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/riwayat/get_list_semua_riwayat";
+
+export default async function Page({ params }: { params: { id: string } }) {
+ let statusRiwayatId = params.id;
+
+ const dataSemuaRiwayat = await event_getListSemuaRiwayat({ page: 1 });
+ const dataRiwayatSaya = await event_getListRiwayatSaya({ page: 1 });
+
+ if (statusRiwayatId == "1") {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ if (statusRiwayatId == "2") {
+ return (
+ <>
+
+ >
+ );
+ }
+}
diff --git a/src/app/dev/event/main/riwayat/page.tsx b/src/app/dev/event/main/riwayat/page.tsx
deleted file mode 100644
index 44f99fd3..00000000
--- a/src/app/dev/event/main/riwayat/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Event_Riwayat } from "@/app_modules/event";
-import { event_getListRiwayatSaya } from "@/app_modules/event/fun/get/get_list_riwayat_saya";
-import { event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/riwayat/get_list_semua_riwayat";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let eventId = params.id;
- const dataSemuaRiwayat = await event_getListSemuaRiwayat({ page: 1 });
- const dataRiwayatSaya = await event_getListRiwayatSaya({ page: 1 });
-
- return (
-
- );
-}
diff --git a/src/app/dev/event/main/status/[id]/page.tsx b/src/app/dev/event/main/status/[id]/page.tsx
new file mode 100644
index 00000000..01ab75d3
--- /dev/null
+++ b/src/app/dev/event/main/status/[id]/page.tsx
@@ -0,0 +1,29 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { Event_StatusPage } from "@/app_modules/event";
+import {
+ event_getAllByStatusId,
+ event_getMasterStatus,
+} from "@/app_modules/event/fun";
+import React from "react";
+
+async function Page({ params }: { params: { id: string } }) {
+ let statusId = params.id;
+ const listStatus = await event_getMasterStatus();
+
+ const dataStatus = await event_getAllByStatusId({
+ page: 1,
+ statusId: statusId,
+ });
+
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/event/main/status_page/page.tsx b/src/app/dev/event/main/status_page/page.tsx
index 4c02d9a1..d99da96d 100644
--- a/src/app/dev/event/main/status_page/page.tsx
+++ b/src/app/dev/event/main/status_page/page.tsx
@@ -14,12 +14,13 @@ export default async function Page() {
const listReject = await event_getAllReject({ page: 1 });
return (
-
+ <>maintenace>
+ //
);
}
diff --git a/src/app/lib/router_hipmi/router_event.ts b/src/app/lib/router_hipmi/router_event.ts
index 833979c2..fcbd0cd9 100644
--- a/src/app/lib/router_hipmi/router_event.ts
+++ b/src/app/lib/router_hipmi/router_event.ts
@@ -2,15 +2,21 @@ export const RouterEvent = {
//main
splash: "/dev/event/splash",
beranda: "/dev/event/main/beranda",
- status_page: "/dev/event/main/status_page",
+ // status_page: "/dev/event/main/status_page",
kontribusi: "/dev/event/main/kontribusi",
- riwayat: "/dev/event/main/riwayat",
+ riwayat: ({ id }: { id: string }) => `/dev/event/main/riwayat/${id}`,
+ /**
+ *
+ * @param statusId | 1 - 4 | 1: Publish, 2: Review, 3: Draft, 4: Reject
+ * @type string
+ */
// status
- status_publish: "/dev/event/main/status_page/publish",
- status_review: "/dev/event/main/status_page/review",
- status_draft: "/dev/event/main/status_page/draft",
- status_reject: "/dev/event/main/status_page/reject",
+ status: ({ id }: { id?: string }) => `/dev/event/main/status/${id}`,
+ // status_publish: "/dev/event/main/status_page/publish",
+ // status_review: "/dev/event/main/status_page/review",
+ // status_draft: "/dev/event/main/status_page/draft",
+ // status_reject: "/dev/event/main/status_page/reject",
//create
create: "/dev/event/create",
diff --git a/src/app_modules/event/create/create.tsx b/src/app_modules/event/create/create.tsx
index 27e45782..c2a6f73f 100644
--- a/src/app_modules/event/create/create.tsx
+++ b/src/app_modules/event/create/create.tsx
@@ -14,7 +14,7 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
import { Event_funCreate } from "../fun/create/fun_create";
-import { gs_event_hotMenu, gs_event_status } from "../global_state";
+import { gs_event_hotMenu } from "../global_state";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import mqtt_client from "@/util/mqtt_client";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
@@ -27,7 +27,6 @@ export default function Event_Create({
authorId: string;
}) {
const router = useRouter();
- const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
const [listTipe, setListTipe] = useState(listTipeAcara);
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
const [isTime, setIsTime] = useState(false);
@@ -177,7 +176,7 @@ export default function Event_Create({
radius={"xl"}
mt={"xl"}
onClick={() => {
- onSave(router, setTabsStatus, value, setHotMenu, setLoading);
+ onSave(router, value, setHotMenu, setLoading);
}}
bg={MainColor.yellow}
color="yellow"
@@ -191,7 +190,6 @@ export default function Event_Create({
async function onSave(
router: AppRouterInstance,
- setTabsStatus: any,
value: any,
setHotMenu: any,
setLoading: any
@@ -231,10 +229,9 @@ async function onSave(
);
ComponentGlobal_NotifikasiBerhasil(res.message);
- setTabsStatus("Review");
setHotMenu(1);
setLoading(true);
- router.push(RouterEvent.status_page);
+ router.push(RouterEvent.status({ id: "2" }), { scroll: false });
}
} else {
ComponentGlobal_NotifikasiGagal(res.message);
diff --git a/src/app_modules/event/detail/draft/index.tsx b/src/app_modules/event/detail/draft/index.tsx
index 6eb84a28..4d0b7661 100644
--- a/src/app_modules/event/detail/draft/index.tsx
+++ b/src/app_modules/event/detail/draft/index.tsx
@@ -1,31 +1,31 @@
"use client";
-import { Button, Group, Stack } from "@mantine/core";
-import ComponentEvent_DetailData from "../../component/detail/detail_data";
+import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
-import { useAtom } from "jotai";
+import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import mqtt_client from "@/util/mqtt_client";
+import { Button, Group, Stack } from "@mantine/core";
import moment from "moment";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import ComponentEvent_DetailData from "../../component/detail/detail_data";
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
-import { gs_event_status } from "../../global_state";
import { MODEL_EVENT } from "../../model/interface";
-import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
-import mqtt_client from "@/util/mqtt_client";
export default function Event_DetailDraft({
dataEvent,
}: {
dataEvent: MODEL_EVENT;
}) {
+ const [data, setData] = useState(dataEvent);
return (
<>
- {/*
{JSON.stringify(dataEvent.catatan)} */}
+ {/* {JSON.stringify(dataEvent.tanggal)} */}
{dataEvent?.catatan ? (
-
+
+
>
);
}
-function ButtonAction({ eventId, tanggal }: { eventId: string; tanggal: any }) {
+function ButtonAction({
+ eventId,
+ tanggal,
+}: {
+ eventId: string;
+ tanggal?: any;
+}) {
const router = useRouter();
const [isLoadingDelete, setLoadingDelete] = useState(false);
const [isLoadingAjukan, setLoadingAjukan] = useState(false);
- const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
const [openModal1, setOpenModal1] = useState(false);
const [openModal2, setOpenModal2] = useState(false);
async function onDelete() {
- await Event_funDeleteById(eventId).then((res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- setLoadingDelete(true);
- setTabsStatus("Draft");
- close();
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
+ const res = await Event_funDeleteById(eventId);
+ if (res.status === 200) {
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ setLoadingDelete(true);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
}
async function onAjukan() {
@@ -91,9 +93,8 @@ function ButtonAction({ eventId, tanggal }: { eventId: string; tanggal: any }) {
})
);
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- setTabsStatus("Review");
setLoadingAjukan(true);
- router.back();
+ router.replace(RouterEvent.status({ id: "2" }));
}
} else {
ComponentGlobal_NotifikasiGagal(res.message);
diff --git a/src/app_modules/event/detail/reject/index.tsx b/src/app_modules/event/detail/reject/index.tsx
index 6e7247f5..6e25c05b 100644
--- a/src/app_modules/event/detail/reject/index.tsx
+++ b/src/app_modules/event/detail/reject/index.tsx
@@ -1,77 +1,38 @@
"use client";
-import {
- Box,
- Button,
- Grid,
- Group,
- Modal,
- Paper,
- SimpleGrid,
- Stack,
- Text,
- Title,
-} from "@mantine/core";
-import ComponentEvent_DetailData from "../../component/detail/detail_data";
-import { useRouter } from "next/navigation";
-import { useAtom } from "jotai";
-import { gs_event_status } from "../../global_state";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { useDisclosure } from "@mantine/hooks";
-import { MODEL_EVENT } from "../../model/interface";
-import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import ComponentEvent_CatatanReject from "../../component/catatan_reject";
-import { Event_funDeleteById } from "../../fun/delete/fun_delete";
+import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
-import { useState } from "react";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import { Button, SimpleGrid, Stack } from "@mantine/core";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import ComponentEvent_DetailData from "../../component/detail/detail_data";
+import { Event_funDeleteById } from "../../fun/delete/fun_delete";
+import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
+import { MODEL_EVENT } from "../../model/interface";
export default function Event_DetailReject({
dataEvent,
}: {
dataEvent: MODEL_EVENT;
}) {
+ const [data, setData] = useState(dataEvent);
return (
<>
-
-
-
+
+
+
-
- {/*
-
- Yakin akan menghapus event ini?
-
-
-
-
-
- */}
>
);
}
function ButtonAction({ eventId }: { eventId: string }) {
const router = useRouter();
- const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
const [openModal1, setOpenModal1] = useState(false);
const [openModal2, setOpenModal2] = useState(false);
@@ -113,7 +74,7 @@ function ButtonAction({ eventId }: { eventId: string }) {
radius={"xl"}
color={"yellow"}
onClick={() => {
- onUpdate(router, setTabsStatus, eventId);
+ onUpdate(router, eventId);
setOpenModal1(false);
}}
>
@@ -137,9 +98,8 @@ function ButtonAction({ eventId }: { eventId: string }) {
radius={"xl"}
color={"red"}
onClick={() => {
- onDelete(router, eventId, close);
+ onDelete(router, eventId);
setOpenModal2(false);
-
}}
>
Hapus
@@ -150,32 +110,23 @@ function ButtonAction({ eventId }: { eventId: string }) {
);
}
-async function onUpdate(
- router: AppRouterInstance,
- setTabsStatus: any,
- eventId: string
-) {
+async function onUpdate(router: AppRouterInstance, eventId: string) {
await Event_funEditStatusById("3", eventId).then((res) => {
if (res.status === 200) {
ComponentGlobal_NotifikasiBerhasil(res.message);
- setTabsStatus("Draft");
- router.back();
+ router.push(RouterEvent.status({ id: "3" }));
} else {
ComponentGlobal_NotifikasiGagal(res.message);
}
});
}
-async function onDelete(
- router: AppRouterInstance,
- eventId: string,
- close: any
-) {
- await Event_funDeleteById(eventId).then((res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
+async function onDelete(router: AppRouterInstance, eventId: string) {
+ const res = await Event_funDeleteById(eventId);
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
}
diff --git a/src/app_modules/event/detail/review/index.tsx b/src/app_modules/event/detail/review/index.tsx
index 489db857..fef47024 100644
--- a/src/app_modules/event/detail/review/index.tsx
+++ b/src/app_modules/event/detail/review/index.tsx
@@ -1,18 +1,17 @@
"use client";
+import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
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 { useAtom } from "jotai";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { useRouter } from "next/navigation";
import { useState } from "react";
import ComponentEvent_DetailData from "../../component/detail/detail_data";
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
-import { gs_event_status } from "../../global_state";
import { MODEL_EVENT } from "../../model/interface";
export default function Event_DetailReview({
@@ -32,14 +31,11 @@ export default function Event_DetailReview({
function ButtonAction({ eventId }: { eventId: string }) {
const router = useRouter();
- const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
const [isLoading, setLoading] = useState(false);
const [openModal, setOpenModal] = useState(false);
return (
<>