Fix: Event

Deskripsi:
- Perbaikan route status event
- Perbaikan route riwayat event
## No Issue
This commit is contained in:
2024-10-28 17:00:23 +08:00
parent 0371ca5e01
commit 81543d678c
33 changed files with 347 additions and 866 deletions

2
.gitignore vendored
View File

@@ -37,3 +37,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
certificates

View File

@@ -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());
}
};

View File

@@ -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"

View File

@@ -1,5 +1,4 @@
import { Admin_Award } from "@/app_modules/admin/award";
import { gen_api } from "../../../../../../gen_api";
export default async function Page() {

View File

@@ -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 (
<>
<Event_Riwayat
statusId={statusRiwayatId}
dataSemuaRiwayat={dataSemuaRiwayat as any}
/>
</>
);
}
if (statusRiwayatId == "2") {
return (
<>
<Event_Riwayat
statusId={statusRiwayatId}
dataRiwayatSaya={dataRiwayatSaya as any}
/>
</>
);
}
}

View File

@@ -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 (
<Event_Riwayat
dataSemuaRiwayat={dataSemuaRiwayat as any}
dataRiwayatSaya={dataRiwayatSaya as any}
/>
);
}

View File

@@ -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 (
<>
<Event_StatusPage
statusId={statusId}
dataStatus={dataStatus}
listStatus={listStatus}
/>
</>
);
}
export default Page;

View File

@@ -14,12 +14,13 @@ export default async function Page() {
const listReject = await event_getAllReject({ page: 1 });
return (
<Event_StatusPage
authorId={userLoginId}
listPublish={listPublish}
listReview={listReview}
listDraft={listDraft}
listReject={listReject}
/>
<>maintenace</>
// <Event_StatusPage
// authorId={userLoginId}
// listPublish={listPublish}
// listReview={listReview}
// listDraft={listDraft}
// listReject={listReject}
// />
);
}

View File

@@ -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",

View File

@@ -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);

View File

@@ -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 (
<>
{/* <pre>{JSON.stringify(dataEvent.catatan)}</pre> */}
{/* <pre>{JSON.stringify(dataEvent.tanggal)}</pre> */}
<Stack spacing={"lg"}>
{dataEvent?.catatan ? (
<ComponentGlobal_BoxInformation
@@ -35,33 +35,35 @@ export default function Event_DetailDraft({
) : (
""
)}
<ComponentEvent_DetailData data={dataEvent} />
<ButtonAction eventId={dataEvent?.id} tanggal={dataEvent.tanggal} />
<ComponentEvent_DetailData data={data} />
<ButtonAction eventId={data.id} tanggal={data.tanggal} />
</Stack>
</>
);
}
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);

View File

@@ -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 (
<>
<Stack spacing={"lg"}>
<ComponentGlobal_BoxInformation
isReport
informasi={dataEvent.catatan}
/>
<ComponentEvent_DetailData data={dataEvent} />
<ButtonAction eventId={dataEvent?.id} />
<ComponentGlobal_BoxInformation isReport informasi={data.catatan} />
<ComponentEvent_DetailData data={data} />
<ButtonAction eventId={data.id} />
</Stack>
{/* <Modal opened={opened} onClose={close} centered withCloseButton={false}>
<Stack>
<Title order={6}>Yakin akan menghapus event ini?</Title>
<Group position="center">
<Button radius={"xl"} onClick={close}>
Batal
</Button>
<Button
radius={"xl"}
onClick={() => {
onDelete(router, dataEvent.id, close);
close();
router.back();
}}
color="red"
>
Hapus
</Button>
</Group>
</Stack>
</Modal> */}
</>
);
}
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);
}
}

View File

@@ -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 (
<>
<Button
loaderPosition="center"
loading={isLoading ? true : false}
radius={"xl"}
color={"orange"}
onClick={() => setOpenModal(true)}
@@ -58,9 +54,11 @@ function ButtonAction({ eventId }: { eventId: string }) {
}
buttonKanan={
<Button
loaderPosition="center"
loading={isLoading}
radius={"xl"}
color={"orange"}
onClick={() => onClick(router, setTabsStatus, eventId, setLoading)}
onClick={() => onClick(router, eventId, setLoading)}
>
Simpan
</Button>
@@ -72,7 +70,6 @@ function ButtonAction({ eventId }: { eventId: string }) {
async function onClick(
router: AppRouterInstance,
setTabsStatus: any,
eventId: string,
setLoading: any
) {
@@ -100,9 +97,8 @@ async function onClick(
);
ComponentGlobal_NotifikasiBerhasil(res.message, 1500);
setTabsStatus("Draft");
setLoading(true);
router.back();
router.replace(RouterEvent.status({ id: "3" }));
}
} else {
ComponentGlobal_NotifikasiGagal(res.message);

View File

@@ -1,9 +1,11 @@
"use server";
import prisma from "@/app/lib/prisma";
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import { revalidatePath } from "next/cache";
export async function Event_funDeleteById(eventId: string) {
console.log(eventId);
const del = await prisma.event.delete({
where: {
id: eventId,
@@ -11,17 +13,9 @@ export async function Event_funDeleteById(eventId: string) {
});
if (!del) return { status: 400, message: "Gagal hapus data" };
// const delTemporary = await prisma.event.update({
// where: {
// id: eventId,
// },
// data: {
// active: false,
// },
// });
// if (!delTemporary) return { status: 400, message: "Gagal hapus data" };
revalidatePath("/dev/event/main/status/3");
revalidatePath("/dev/event/main/status/4");
revalidatePath("/dev/event/main/status_page");
return {
status: 200,
message: "Hapus data berhasil",

View File

@@ -3,6 +3,7 @@
import prisma from "@/app/lib/prisma";
import { MODEL_EVENT } from "../../model/interface";
import { revalidatePath } from "next/cache";
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
export async function Event_funEditById(data: MODEL_EVENT) {
const updt = await prisma.event.update({
@@ -19,7 +20,7 @@ export async function Event_funEditById(data: MODEL_EVENT) {
});
if (!updt) return { status: 400, message: "Update Gagal" };
revalidatePath("/dev/event/detail/event");
revalidatePath(RouterEvent.detail_draft + data.id);
return {
status: 200,
message: "Berhasil Update",

View File

@@ -0,0 +1,38 @@
"use server";
import { prisma } from "@/app/lib";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getAllByStatusId({
page,
statusId,
}: {
page: number;
statusId: string;
}) {
const userLoginId = await funGetUserIdByToken();
const takeData = 10;
const skipData = page * takeData - takeData;
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;
}

View File

@@ -0,0 +1,5 @@
import { event_getAllByStatusId } from "./get/status/get_all_by_status_id";
import { event_getMasterStatus } from "./master/get_status_event";
export { event_getAllByStatusId };
export { event_getMasterStatus };

View File

@@ -0,0 +1,9 @@
"use server";
import { prisma } from "@/app/lib";
export async function event_getMasterStatus() {
const data = await prisma.eventMaster_Status.findMany({});
return data;
}

View File

@@ -11,9 +11,3 @@ export const gs_event_hotMenu = atomWithStorage("gs_event_hotMenu", 0)
* @type string
*/
export const gs_event_status = atomWithStorage<string | any>("gs_status_event", "Publish")
/**
* @param riwayat | "Semua", "Saya"
* @type string
*/
export const gs_event_riwayat = atomWithStorage<string | any>("gs_event_riwayat", "Semua")

View File

@@ -6,17 +6,12 @@ import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import {
ActionIcon,
SimpleGrid,
Stack,
Text
} from "@mantine/core";
import { ActionIcon, SimpleGrid, Stack, Text } from "@mantine/core";
import {
IconCalendarEvent,
IconHistory,
IconHome,
IconTimelineEventText
IconTimelineEventText,
} from "@tabler/icons-react";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
@@ -42,7 +37,7 @@ export default function LayoutEvent_Main({
{
id: "2",
name: "Status",
path: RouterEvent.status_page,
path: RouterEvent.status({ id: "1" }),
icon: <IconTimelineEventText />,
},
{
@@ -54,7 +49,7 @@ export default function LayoutEvent_Main({
{
id: "4",
name: "Riwayat",
path: RouterEvent.riwayat,
path: RouterEvent.riwayat({ id: "1" }),
icon: <IconHistory />,
},
];

View File

@@ -1,48 +1,57 @@
"use client";
import { Stack, Tabs } from "@mantine/core";
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import { useAtom } from "jotai";
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { useRouter } from "next/navigation";
import { gs_event_riwayat } from "../../global_state";
import { useState } from "react";
import { MODEL_EVENT } from "../../model/interface";
import Event_RiwayatSaya from "./saya";
import Event_SemuaRiwayat from "./semua";
export default function Event_Riwayat({
statusId,
dataSemuaRiwayat,
dataRiwayatSaya
dataRiwayatSaya,
}: {
dataSemuaRiwayat: MODEL_EVENT[];
dataRiwayatSaya: MODEL_EVENT[]
statusId: string;
dataSemuaRiwayat?: MODEL_EVENT[];
dataRiwayatSaya?: MODEL_EVENT[];
}) {
const router = useRouter();
const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_event_riwayat)
// const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_event_riwayat)
const [changeStatus, setChangeStatus] = useState(statusId);
const listTabs = [
{
id: 1,
id: "1",
label: "Semua Riwayat",
value: "Semua",
path: <Event_SemuaRiwayat listData={dataSemuaRiwayat as any} />,
},
{
id: 2,
id: "2",
label: "Riwayat Saya",
value: "Saya",
path: <Event_RiwayatSaya listData={dataRiwayatSaya as any} />,
},
];
async function onChangeStatus({ statusId }: { statusId: string }) {
router.push(RouterEvent.riwayat({ id: statusId }));
}
return (
<>
<Tabs
defaultValue={"Semua"}
variant="pills"
radius={"xl"}
onTabChange={setTabsRiwayat}
value={tabsRiwayat}
value={changeStatus}
onTabChange={(val: any) => {
setChangeStatus(val);
onChangeStatus({ statusId: val });
}}
styles={{
tabsList: {
backgroundColor: MainColor.darkblue,
@@ -57,15 +66,15 @@ export default function Event_Riwayat({
{listTabs.map((e) => (
<Tabs.Tab
key={e.id}
value={e.value}
value={e.id}
fw={"bold"}
c={"black"}
style={{
transition: "0.5s",
backgroundColor:
tabsRiwayat === e.value ? MainColor.yellow : "white",
changeStatus === e.id ? MainColor.yellow : "white",
border:
tabsRiwayat === e.value
changeStatus === e.id
? `1px solid ${AccentColor.yellow}`
: `1px solid white`,
}}
@@ -74,11 +83,12 @@ export default function Event_Riwayat({
</Tabs.Tab>
))}
</Tabs.List>
{listTabs.map((e) => (
<Tabs.Panel key={e.id} value={e.value}>
{e.path}
</Tabs.Panel>
))}
{statusId == "1" && (
<Event_SemuaRiwayat listData={dataSemuaRiwayat as any} />
)}
{statusId == "2" && (
<Event_RiwayatSaya listData={dataRiwayatSaya as any} />
)}
</Stack>
</Tabs>
</>

View File

@@ -9,7 +9,7 @@ import { useState } from "react";
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
import { MODEL_EVENT } from "../../model/interface";
import { event_getListRiwayatSaya } from "../../fun/get/get_list_riwayat_saya";
import { event_getListRiwayatSaya } from "../../fun/get/riwayat/get_list_riwayat_saya";
export default function Event_RiwayatSaya({
listData,

View File

@@ -1,64 +1,47 @@
"use client";
import { Stack, Tabs } from "@mantine/core";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import { gs_event_status } from "../../global_state";
import Event_StatusDraft from "./draft";
import Event_StatusPublish from "./publish";
import Event_StatusReject from "./reject";
import Event_StatusReview from "./review";
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
import { Box, Stack, Tabs } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
import Event_StatusDraft from "./draft";
import Event_StatusPublish from "./publish";
import Event_StatusReject from "./reject";
import Event_StatusReview from "./review";
export default function Event_StatusPage({
authorId,
listPublish,
listReview,
listDraft,
listReject,
statusId,
dataStatus,
listStatus,
}: {
authorId: string;
listPublish: any;
listReview: any;
listDraft: any;
listReject: any;
statusId: string;
dataStatus: any[];
listStatus: MODEL_NEW_DEFAULT_MASTER[];
}) {
const router = useRouter();
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
const listTabs = [
{
id: 1,
path: <Event_StatusPublish listPublish={listPublish} />,
value: "Publish",
},
{
id: 2,
path: <Event_StatusReview listReview={listReview} />,
value: "Review",
},
{
id: 3,
path: <Event_StatusDraft listDraft={listDraft} />,
value: "Draft",
},
{
id: 4,
path: <Event_StatusReject listReject={listReject} />,
value: "Reject",
},
];
const [changeStatus, setChangeStatus] = useState(statusId);
async function onChangeStatus({ statusId }: { statusId: string }) {
router.push(RouterEvent.status({ id: statusId }));
}
return (
<>
<Tabs
variant="pills"
radius="xl"
mt={1}
defaultValue="Publish"
value={tabsStatus}
onTabChange={setTabsStatus}
// defaultValue={"1"}
value={changeStatus}
onTabChange={(val: any) => {
setChangeStatus(val);
onChangeStatus({ statusId: val });
}}
styles={{
tabsList: {
backgroundColor: MainColor.darkblue,
@@ -70,33 +53,95 @@ export default function Event_StatusPage({
>
<Stack>
<Tabs.List grow>
{listTabs.map((e) => (
{listStatus.map((e) => (
<Tabs.Tab
key={e.id}
value={e.value}
value={e.id}
fw={"bold"}
c={"black"}
style={{
transition: "0.5s",
backgroundColor:
tabsStatus === e.value ? MainColor.yellow : "white",
changeStatus === e.id ? MainColor.yellow : "white",
border:
tabsStatus === e.value
changeStatus === e.id
? `1px solid ${AccentColor.yellow}`
: `1px solid white`,
}}
>
{e.value}
{e.name}
</Tabs.Tab>
))}
</Tabs.List>
{listTabs.map((e) => (
<Tabs.Panel key={e.id} value={e.value}>
{e.path}
</Tabs.Panel>
))}
<Box>
{changeStatus === "1" && (
<Event_StatusPublish listPublish={dataStatus} />
)}
{changeStatus === "2" && (
<Event_StatusReview listReview={dataStatus} />
)}
{changeStatus === "3" && (
<Event_StatusDraft listDraft={dataStatus} />
)}
{changeStatus === "4" && (
<Event_StatusReject listReject={dataStatus} />
)}
</Box>
</Stack>
</Tabs>
</>
);
// return (
// <>
// <Tabs
// variant="pills"
// radius="xl"
// mt={1}
// defaultValue={changeStatus}
// value={changeStatus}
// onTabChange={(val: any) => {
// console.log(val);
// }}
// styles={{
// tabsList: {
// backgroundColor: MainColor.darkblue,
// position: "sticky",
// top: 0,
// zIndex: 99,
// },
// }}
// >
// <Stack>
// <Tabs.List grow>
// {listStatus.map((e) => (
// <Tabs.Tab
// key={e.id}
// value={e.name}
// fw={"bold"}
// c={"black"}
// // style={{
// // transition: "0.5s",
// // backgroundColor:
// // tabsStatus === e.name ? MainColor.yellow : "white",
// // border:
// // tabsStatus === e.name
// // ? `1px solid ${AccentColor.yellow}`
// // : `1px solid white`,
// // }}
// >
// {e.name}
// </Tabs.Tab>
// ))}
// </Tabs.List>
// {/* {listTabs.map((e) => (
// <Tabs.Panel key={e.id} value={e.value}>
// {e.path}
// </Tabs.Panel>
// ))} */}
// </Stack>
// </Tabs>
// </>
// );
}

View File

@@ -1,27 +1,18 @@
"use client";
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import {
Box,
Center,
Group,
Loader,
Paper,
Stack,
Text,
Title,
Loader
} from "@mantine/core";
import moment from "moment";
import { useRouter } from "next/navigation";
import { MODEL_EVENT } from "../../model/interface";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import _ from "lodash";
import ComponentEvent_IsEmptyData from "../../component/is_empty_data";
import { event_getAllReject } from "../../fun/get/status/get_all_reject";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import { event_getAllReview } from "../../fun/get/status/get_all_review";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import { event_getAllReject } from "../../fun/get/status/get_all_reject";
import { MODEL_EVENT } from "../../model/interface";
export default function Event_StatusReject({
listReject,

View File

@@ -12,10 +12,8 @@ import { MODEL_EVENT } from "../../model/interface";
export default function Event_StatusReview({
listReview,
}: {
listReview: MODEL_EVENT[];
}) {
const [data, setData] = useState(listReview);
const [activePage, setActivePage] = useState(1);

View File

@@ -6,18 +6,16 @@ import { useShallowEffect } from "@mantine/hooks";
import { IconPresentation } from "@tabler/icons-react";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import { gs_event_hotMenu, gs_event_status } from "../global_state";
import { gs_event_hotMenu } from "../global_state";
export default function Event_SplashScreen() {
const router = useRouter();
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
useShallowEffect(() => {
setTimeout(() => {
router.replace(RouterEvent.beranda);
setHotMenu(0);
setTabsStatus("Publish");
}, 1000);
}, []);
return (

View File

@@ -11,7 +11,7 @@ export function redirectEventPage({
router: AppRouterInstance;
onSetPage: (val: any) => void;
}) {
const path = RouterEvent.status_page;
const path = RouterEvent.status({id: ""});
if (data.status === "Publish") {
onSetPage({

View File

@@ -1,59 +0,0 @@
"use client";
"use dev";
import { Flex } from "@mantine/core";
import { DevBox } from "next-dev";
import { useState } from "react";
// Beda Package
import InfiniteScroll from "react-infinite-scroll-component";
import { CobaSatu } from "./CobaSatu";
import { TombolDev } from "./TombolDev";
export default function Coba() {
const [data, setData] = useState<any[]>([]);
const [isLoading, setIsLoading] = useState(false);
const ttlData = Array.from({ length: 21 });
const [list, setList] = useState<any[]>(ttlData);
const fetchMoreData = () => {
setTimeout(() => {
setList(list.concat(Array.from({ length: 20 })));
}, 100);
};
const style = {
height: 30,
border: "1px solid green",
margin: 6,
padding: 8,
};
return (
<DevBox path="dnNjb2RlOi8vZmlsZS8vVXNlcnMvYmFnYXNiYW51bmEvRG9jdW1lbnRzL0JJUC9oaXBtaS9zcmMvdWkvQ29iYS50c3g6MzE6MQ==">
<Flex gap={"lg"}>
<div id="scrollableDiv" style={{ height: "100vh", overflow: "auto" }}>
<InfiniteScroll
dataLength={list.length}
next={fetchMoreData}
hasMore={true}
loader={
<center>
<h4>Loading...</h4>
</center>
}
scrollableTarget="scrollableDiv"
>
{list.map((i, index) => (
<div style={style} key={index}>
div - #{index}
</div>
))}
</InfiniteScroll>
</div>
<CobaSatu />
<TombolDev />
</Flex>
</DevBox>
);
}

View File

@@ -1,21 +0,0 @@
"use client";
"use dev";
import { DevBox } from "next-dev";
import { Card } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { genFetchApi } from "@/util/genFetchApi";
export function CobaSatu() {
useShallowEffect(() => {
genFetchApi
.seeder({ isServer: false })
.then(async (v) => {
console.log(v)
})
}, []);
return (
<DevBox path="dnNjb2RlOi8vZmlsZS8vVXNlcnMvYmFnYXNiYW51bmEvRG9jdW1lbnRzL0JJUC9oaXBtaS9zcmMvdWkvQ29iYVNhdHUudHN4Ojc6MQ==">
<Card>ini percobaan</Card>
</DevBox>
);
}

View File

@@ -1,14 +0,0 @@
import { Button } from "@mantine/core";
import { ButtonToogle } from "next-dev";
export function TombolDev() {
return (
<ButtonToogle>
{(isDev) => (
<Button color={isDev ? "blue" : "grape"}>
{isDev ? "Development" : "Production"}
</Button>
)}
</ButtonToogle>
);
}

View File

@@ -1,13 +0,0 @@
import os from "os";
const app_config = {
title: "Example Title",
description: "Example Description",
host:
os.platform() === "darwin"
? "http://localhost:3000"
: "https://test2-hipmi.wibudev.com",
isLocal: os.platform() === "darwin",
};
export default app_config;

View File

@@ -1,278 +0,0 @@
import app_config from "./app_config";
export const genFetchApi = {
/**
* [/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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
testScroll : async ({isServer, searchParams}: {isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/test-scroll${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
seeder : async ({isServer, searchParams}: {isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/seeder${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
profileUrl_fotoUrlByUrl : async ({url, isServer, searchParams}: {url: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/url_foto/${url}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
profileUrl_backgroundUrlByUrl : async ({url, isServer, searchParams}: {url: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/url_background/${url}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
profileFotoIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/foto/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
profileBackgroundIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/profile/background/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
portofolioLogoIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/portofolio/logo/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
jobGambarIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/job/gambar/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
investasiProspektusIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/prospektus/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
investasiMidtransIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/midtrans/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
investasiGambarIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/gambar/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
investasiDokumenIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/investasi/dokumen/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiImage_ceritaUrlByUrl : async ({url, isServer, searchParams}: {url: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/image_cerita/${url}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiImageUrlByUrl : async ({url, isServer, searchParams}: {url: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/image/${url}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiGambar_pencairanIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_pencairan/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiGambar_kabarIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_kabar/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiGambar_ceritaIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_cerita/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiGambar_bukti_transferIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar_bukti_transfer/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
donasiGambarIdById : async ({id, isServer, searchParams}: {id: string, isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/donasi/gambar/${id}${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
authValidasi : async ({isServer, searchParams}: {isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/validasi${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
authRegister : async ({isServer, searchParams}: {isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/register${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
authLogout : async ({isServer, searchParams}: {isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/logout${searchParams || ''}`, { 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)
* @param {}
* @param {boolean} isServer
* @param {string} searchParams ?key=value
*/
authLogin : async ({isServer, searchParams}: {isServer?: boolean, searchParams?: string}) => {
return fetch(`${isServer && app_config.host || ''}/api/auth/login${searchParams || ''}`, { method: 'POST', cache: 'no-cache' })
.then(res => res.json());
}
};