2
.gitignore
vendored
2
.gitignore
vendored
@@ -37,3 +37,5 @@ yarn-error.log*
|
|||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
|
certificates
|
||||||
210
gen_api.ts
210
gen_api.ts
@@ -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());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.0.6",
|
"version": "1.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "npx tsx prisma/seed.ts"
|
"seed": "npx tsx prisma/seed.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev ",
|
"dev": "next dev --experimental-https",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Admin_Award } from "@/app_modules/admin/award";
|
import { Admin_Award } from "@/app_modules/admin/award";
|
||||||
import { gen_api } from "../../../../../../gen_api";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
|
||||||
|
|||||||
32
src/app/dev/event/main/riwayat/[id]/page.tsx
Normal file
32
src/app/dev/event/main/riwayat/[id]/page.tsx
Normal 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}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
29
src/app/dev/event/main/status/[id]/page.tsx
Normal file
29
src/app/dev/event/main/status/[id]/page.tsx
Normal 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;
|
||||||
@@ -14,12 +14,13 @@ export default async function Page() {
|
|||||||
const listReject = await event_getAllReject({ page: 1 });
|
const listReject = await event_getAllReject({ page: 1 });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Event_StatusPage
|
<>maintenace</>
|
||||||
authorId={userLoginId}
|
// <Event_StatusPage
|
||||||
listPublish={listPublish}
|
// authorId={userLoginId}
|
||||||
listReview={listReview}
|
// listPublish={listPublish}
|
||||||
listDraft={listDraft}
|
// listReview={listReview}
|
||||||
listReject={listReject}
|
// listDraft={listDraft}
|
||||||
/>
|
// listReject={listReject}
|
||||||
|
// />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,21 @@ export const RouterEvent = {
|
|||||||
//main
|
//main
|
||||||
splash: "/dev/event/splash",
|
splash: "/dev/event/splash",
|
||||||
beranda: "/dev/event/main/beranda",
|
beranda: "/dev/event/main/beranda",
|
||||||
status_page: "/dev/event/main/status_page",
|
// status_page: "/dev/event/main/status_page",
|
||||||
kontribusi: "/dev/event/main/kontribusi",
|
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
|
||||||
status_publish: "/dev/event/main/status_page/publish",
|
status: ({ id }: { id?: string }) => `/dev/event/main/status/${id}`,
|
||||||
status_review: "/dev/event/main/status_page/review",
|
// status_publish: "/dev/event/main/status_page/publish",
|
||||||
status_draft: "/dev/event/main/status_page/draft",
|
// status_review: "/dev/event/main/status_page/review",
|
||||||
status_reject: "/dev/event/main/status_page/reject",
|
// status_draft: "/dev/event/main/status_page/draft",
|
||||||
|
// status_reject: "/dev/event/main/status_page/reject",
|
||||||
|
|
||||||
//create
|
//create
|
||||||
create: "/dev/event/create",
|
create: "/dev/event/create",
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
||||||
import { Event_funCreate } from "../fun/create/fun_create";
|
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 { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
@@ -27,7 +27,6 @@ export default function Event_Create({
|
|||||||
authorId: string;
|
authorId: string;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
|
|
||||||
const [listTipe, setListTipe] = useState(listTipeAcara);
|
const [listTipe, setListTipe] = useState(listTipeAcara);
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
|
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
|
||||||
const [isTime, setIsTime] = useState(false);
|
const [isTime, setIsTime] = useState(false);
|
||||||
@@ -177,7 +176,7 @@ export default function Event_Create({
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
mt={"xl"}
|
mt={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onSave(router, setTabsStatus, value, setHotMenu, setLoading);
|
onSave(router, value, setHotMenu, setLoading);
|
||||||
}}
|
}}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
@@ -191,7 +190,6 @@ export default function Event_Create({
|
|||||||
|
|
||||||
async function onSave(
|
async function onSave(
|
||||||
router: AppRouterInstance,
|
router: AppRouterInstance,
|
||||||
setTabsStatus: any,
|
|
||||||
value: any,
|
value: any,
|
||||||
setHotMenu: any,
|
setHotMenu: any,
|
||||||
setLoading: any
|
setLoading: any
|
||||||
@@ -231,10 +229,9 @@ async function onSave(
|
|||||||
);
|
);
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setTabsStatus("Review");
|
|
||||||
setHotMenu(1);
|
setHotMenu(1);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterEvent.status_page);
|
router.push(RouterEvent.status({ id: "2" }), { scroll: false });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Button, Group, Stack } from "@mantine/core";
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
|
||||||
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 { 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 moment from "moment";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
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";
|
||||||
import { gs_event_status } from "../../global_state";
|
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
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({
|
export default function Event_DetailDraft({
|
||||||
dataEvent,
|
dataEvent,
|
||||||
}: {
|
}: {
|
||||||
dataEvent: MODEL_EVENT;
|
dataEvent: MODEL_EVENT;
|
||||||
}) {
|
}) {
|
||||||
|
const [data, setData] = useState(dataEvent);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(dataEvent.catatan)}</pre> */}
|
{/* <pre>{JSON.stringify(dataEvent.tanggal)}</pre> */}
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
{dataEvent?.catatan ? (
|
{dataEvent?.catatan ? (
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation
|
||||||
@@ -35,33 +35,35 @@ export default function Event_DetailDraft({
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
<ComponentEvent_DetailData data={dataEvent} />
|
<ComponentEvent_DetailData data={data} />
|
||||||
<ButtonAction eventId={dataEvent?.id} tanggal={dataEvent.tanggal} />
|
<ButtonAction eventId={data.id} tanggal={data.tanggal} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ButtonAction({ eventId, tanggal }: { eventId: string; tanggal: any }) {
|
function ButtonAction({
|
||||||
|
eventId,
|
||||||
|
tanggal,
|
||||||
|
}: {
|
||||||
|
eventId: string;
|
||||||
|
tanggal?: any;
|
||||||
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoadingDelete, setLoadingDelete] = useState(false);
|
const [isLoadingDelete, setLoadingDelete] = useState(false);
|
||||||
const [isLoadingAjukan, setLoadingAjukan] = useState(false);
|
const [isLoadingAjukan, setLoadingAjukan] = useState(false);
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
|
|
||||||
const [openModal1, setOpenModal1] = useState(false);
|
const [openModal1, setOpenModal1] = useState(false);
|
||||||
const [openModal2, setOpenModal2] = useState(false);
|
const [openModal2, setOpenModal2] = useState(false);
|
||||||
|
|
||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
await Event_funDeleteById(eventId).then((res) => {
|
const res = await Event_funDeleteById(eventId);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
router.back();
|
||||||
setLoadingDelete(true);
|
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
||||||
setTabsStatus("Draft");
|
setLoadingDelete(true);
|
||||||
close();
|
} else {
|
||||||
router.back();
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
} else {
|
}
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onAjukan() {
|
async function onAjukan() {
|
||||||
@@ -91,9 +93,8 @@ function ButtonAction({ eventId, tanggal }: { eventId: string; tanggal: any }) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
||||||
setTabsStatus("Review");
|
|
||||||
setLoadingAjukan(true);
|
setLoadingAjukan(true);
|
||||||
router.back();
|
router.replace(RouterEvent.status({ id: "2" }));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
|||||||
@@ -1,77 +1,38 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
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 ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
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 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({
|
export default function Event_DetailReject({
|
||||||
dataEvent,
|
dataEvent,
|
||||||
}: {
|
}: {
|
||||||
dataEvent: MODEL_EVENT;
|
dataEvent: MODEL_EVENT;
|
||||||
}) {
|
}) {
|
||||||
|
const [data, setData] = useState(dataEvent);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation isReport informasi={data.catatan} />
|
||||||
isReport
|
<ComponentEvent_DetailData data={data} />
|
||||||
informasi={dataEvent.catatan}
|
<ButtonAction eventId={data.id} />
|
||||||
/>
|
|
||||||
<ComponentEvent_DetailData data={dataEvent} />
|
|
||||||
<ButtonAction eventId={dataEvent?.id} />
|
|
||||||
</Stack>
|
</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 }) {
|
function ButtonAction({ eventId }: { eventId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
|
|
||||||
const [openModal1, setOpenModal1] = useState(false);
|
const [openModal1, setOpenModal1] = useState(false);
|
||||||
const [openModal2, setOpenModal2] = useState(false);
|
const [openModal2, setOpenModal2] = useState(false);
|
||||||
|
|
||||||
@@ -113,7 +74,7 @@ function ButtonAction({ eventId }: { eventId: string }) {
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color={"yellow"}
|
color={"yellow"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onUpdate(router, setTabsStatus, eventId);
|
onUpdate(router, eventId);
|
||||||
setOpenModal1(false);
|
setOpenModal1(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -137,9 +98,8 @@ function ButtonAction({ eventId }: { eventId: string }) {
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color={"red"}
|
color={"red"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onDelete(router, eventId, close);
|
onDelete(router, eventId);
|
||||||
setOpenModal2(false);
|
setOpenModal2(false);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Hapus
|
Hapus
|
||||||
@@ -150,32 +110,23 @@ function ButtonAction({ eventId }: { eventId: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onUpdate(
|
async function onUpdate(router: AppRouterInstance, eventId: string) {
|
||||||
router: AppRouterInstance,
|
|
||||||
setTabsStatus: any,
|
|
||||||
eventId: string
|
|
||||||
) {
|
|
||||||
await Event_funEditStatusById("3", eventId).then((res) => {
|
await Event_funEditStatusById("3", eventId).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setTabsStatus("Draft");
|
router.push(RouterEvent.status({ id: "3" }));
|
||||||
router.back();
|
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onDelete(
|
async function onDelete(router: AppRouterInstance, eventId: string) {
|
||||||
router: AppRouterInstance,
|
const res = await Event_funDeleteById(eventId);
|
||||||
eventId: string,
|
if (res.status === 200) {
|
||||||
close: any
|
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
||||||
) {
|
router.back();
|
||||||
await Event_funDeleteById(eventId).then((res) => {
|
} else {
|
||||||
if (res.status === 200) {
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
}
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
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 notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import { Button, Stack } from "@mantine/core";
|
import { Button, Stack } from "@mantine/core";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||||
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
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 { MODEL_EVENT } from "../../model/interface";
|
||||||
|
|
||||||
export default function Event_DetailReview({
|
export default function Event_DetailReview({
|
||||||
@@ -32,14 +31,11 @@ export default function Event_DetailReview({
|
|||||||
|
|
||||||
function ButtonAction({ eventId }: { eventId: string }) {
|
function ButtonAction({ eventId }: { eventId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
|
|
||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
const [openModal, setOpenModal] = useState(false);
|
const [openModal, setOpenModal] = useState(false);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
loaderPosition="center"
|
|
||||||
loading={isLoading ? true : false}
|
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color={"orange"}
|
color={"orange"}
|
||||||
onClick={() => setOpenModal(true)}
|
onClick={() => setOpenModal(true)}
|
||||||
@@ -58,9 +54,11 @@ function ButtonAction({ eventId }: { eventId: string }) {
|
|||||||
}
|
}
|
||||||
buttonKanan={
|
buttonKanan={
|
||||||
<Button
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoading}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color={"orange"}
|
color={"orange"}
|
||||||
onClick={() => onClick(router, setTabsStatus, eventId, setLoading)}
|
onClick={() => onClick(router, eventId, setLoading)}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
@@ -72,7 +70,6 @@ function ButtonAction({ eventId }: { eventId: string }) {
|
|||||||
|
|
||||||
async function onClick(
|
async function onClick(
|
||||||
router: AppRouterInstance,
|
router: AppRouterInstance,
|
||||||
setTabsStatus: any,
|
|
||||||
eventId: string,
|
eventId: string,
|
||||||
setLoading: any
|
setLoading: any
|
||||||
) {
|
) {
|
||||||
@@ -100,9 +97,8 @@ async function onClick(
|
|||||||
);
|
);
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message, 1500);
|
ComponentGlobal_NotifikasiBerhasil(res.message, 1500);
|
||||||
setTabsStatus("Draft");
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.back();
|
router.replace(RouterEvent.status({ id: "3" }));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function Event_funDeleteById(eventId: string) {
|
export async function Event_funDeleteById(eventId: string) {
|
||||||
|
console.log(eventId);
|
||||||
const del = await prisma.event.delete({
|
const del = await prisma.event.delete({
|
||||||
where: {
|
where: {
|
||||||
id: eventId,
|
id: eventId,
|
||||||
@@ -11,17 +13,9 @@ export async function Event_funDeleteById(eventId: string) {
|
|||||||
});
|
});
|
||||||
if (!del) return { status: 400, message: "Gagal hapus data" };
|
if (!del) return { status: 400, message: "Gagal hapus data" };
|
||||||
|
|
||||||
// const delTemporary = await prisma.event.update({
|
revalidatePath("/dev/event/main/status/3");
|
||||||
// where: {
|
revalidatePath("/dev/event/main/status/4");
|
||||||
// id: eventId,
|
|
||||||
// },
|
|
||||||
// data: {
|
|
||||||
// active: false,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// if (!delTemporary) return { status: 400, message: "Gagal hapus data" };
|
|
||||||
|
|
||||||
revalidatePath("/dev/event/main/status_page");
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Hapus data berhasil",
|
message: "Hapus data berhasil",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../model/interface";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
|
|
||||||
export async function Event_funEditById(data: MODEL_EVENT) {
|
export async function Event_funEditById(data: MODEL_EVENT) {
|
||||||
const updt = await prisma.event.update({
|
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" };
|
if (!updt) return { status: 400, message: "Update Gagal" };
|
||||||
revalidatePath("/dev/event/detail/event");
|
revalidatePath(RouterEvent.detail_draft + data.id);
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil Update",
|
message: "Berhasil Update",
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
5
src/app_modules/event/fun/index.ts
Normal file
5
src/app_modules/event/fun/index.ts
Normal 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 };
|
||||||
9
src/app_modules/event/fun/master/get_status_event.ts
Normal file
9
src/app_modules/event/fun/master/get_status_event.ts
Normal 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;
|
||||||
|
}
|
||||||
@@ -11,9 +11,3 @@ export const gs_event_hotMenu = atomWithStorage("gs_event_hotMenu", 0)
|
|||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
export const gs_event_status = atomWithStorage<string | any>("gs_status_event", "Publish")
|
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")
|
|
||||||
@@ -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 { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import {
|
import { ActionIcon, SimpleGrid, Stack, Text } from "@mantine/core";
|
||||||
ActionIcon,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
|
||||||
Text
|
|
||||||
} from "@mantine/core";
|
|
||||||
import {
|
import {
|
||||||
IconCalendarEvent,
|
IconCalendarEvent,
|
||||||
IconHistory,
|
IconHistory,
|
||||||
IconHome,
|
IconHome,
|
||||||
IconTimelineEventText
|
IconTimelineEventText,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@@ -42,7 +37,7 @@ export default function LayoutEvent_Main({
|
|||||||
{
|
{
|
||||||
id: "2",
|
id: "2",
|
||||||
name: "Status",
|
name: "Status",
|
||||||
path: RouterEvent.status_page,
|
path: RouterEvent.status({ id: "1" }),
|
||||||
icon: <IconTimelineEventText />,
|
icon: <IconTimelineEventText />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,7 +49,7 @@ export default function LayoutEvent_Main({
|
|||||||
{
|
{
|
||||||
id: "4",
|
id: "4",
|
||||||
name: "Riwayat",
|
name: "Riwayat",
|
||||||
path: RouterEvent.riwayat,
|
path: RouterEvent.riwayat({ id: "1" }),
|
||||||
icon: <IconHistory />,
|
icon: <IconHistory />,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,48 +1,57 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Stack, Tabs } from "@mantine/core";
|
import { Stack, Tabs } from "@mantine/core";
|
||||||
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
import {
|
||||||
import { useAtom } from "jotai";
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_event_riwayat } from "../../global_state";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../model/interface";
|
||||||
import Event_RiwayatSaya from "./saya";
|
import Event_RiwayatSaya from "./saya";
|
||||||
import Event_SemuaRiwayat from "./semua";
|
import Event_SemuaRiwayat from "./semua";
|
||||||
|
|
||||||
export default function Event_Riwayat({
|
export default function Event_Riwayat({
|
||||||
|
statusId,
|
||||||
dataSemuaRiwayat,
|
dataSemuaRiwayat,
|
||||||
dataRiwayatSaya
|
dataRiwayatSaya,
|
||||||
}: {
|
}: {
|
||||||
dataSemuaRiwayat: MODEL_EVENT[];
|
statusId: string;
|
||||||
dataRiwayatSaya: MODEL_EVENT[]
|
dataSemuaRiwayat?: MODEL_EVENT[];
|
||||||
|
dataRiwayatSaya?: MODEL_EVENT[];
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_event_riwayat)
|
// const [tabsRiwayat, setTabsRiwayat] = useAtom(gs_event_riwayat)
|
||||||
|
const [changeStatus, setChangeStatus] = useState(statusId);
|
||||||
|
|
||||||
const listTabs = [
|
const listTabs = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: "1",
|
||||||
label: "Semua Riwayat",
|
label: "Semua Riwayat",
|
||||||
value: "Semua",
|
value: "Semua",
|
||||||
path: <Event_SemuaRiwayat listData={dataSemuaRiwayat as any} />,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: "2",
|
||||||
label: "Riwayat Saya",
|
label: "Riwayat Saya",
|
||||||
value: "Saya",
|
value: "Saya",
|
||||||
path: <Event_RiwayatSaya listData={dataRiwayatSaya as any} />,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
async function onChangeStatus({ statusId }: { statusId: string }) {
|
||||||
|
router.push(RouterEvent.riwayat({ id: statusId }));
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tabs
|
<Tabs
|
||||||
defaultValue={"Semua"}
|
|
||||||
variant="pills"
|
variant="pills"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onTabChange={setTabsRiwayat}
|
value={changeStatus}
|
||||||
value={tabsRiwayat}
|
onTabChange={(val: any) => {
|
||||||
|
setChangeStatus(val);
|
||||||
|
onChangeStatus({ statusId: val });
|
||||||
|
}}
|
||||||
styles={{
|
styles={{
|
||||||
tabsList: {
|
tabsList: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
@@ -57,15 +66,15 @@ export default function Event_Riwayat({
|
|||||||
{listTabs.map((e) => (
|
{listTabs.map((e) => (
|
||||||
<Tabs.Tab
|
<Tabs.Tab
|
||||||
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:
|
||||||
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`,
|
||||||
}}
|
}}
|
||||||
@@ -74,11 +83,12 @@ export default function Event_Riwayat({
|
|||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
))}
|
))}
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
{listTabs.map((e) => (
|
{statusId == "1" && (
|
||||||
<Tabs.Panel key={e.id} value={e.value}>
|
<Event_SemuaRiwayat listData={dataSemuaRiwayat as any} />
|
||||||
{e.path}
|
)}
|
||||||
</Tabs.Panel>
|
{statusId == "2" && (
|
||||||
))}
|
<Event_RiwayatSaya listData={dataRiwayatSaya as any} />
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { useState } from "react";
|
|||||||
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
|
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
|
||||||
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
|
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
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({
|
export default function Event_RiwayatSaya({
|
||||||
listData,
|
listData,
|
||||||
|
|||||||
@@ -1,64 +1,47 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Stack, Tabs } from "@mantine/core";
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
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 {
|
import {
|
||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} 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({
|
export default function Event_StatusPage({
|
||||||
authorId,
|
statusId,
|
||||||
listPublish,
|
dataStatus,
|
||||||
listReview,
|
listStatus,
|
||||||
listDraft,
|
|
||||||
listReject,
|
|
||||||
}: {
|
}: {
|
||||||
authorId: string;
|
statusId: string;
|
||||||
listPublish: any;
|
dataStatus: any[];
|
||||||
listReview: any;
|
listStatus: MODEL_NEW_DEFAULT_MASTER[];
|
||||||
listDraft: any;
|
|
||||||
listReject: any;
|
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
|
const [changeStatus, setChangeStatus] = useState(statusId);
|
||||||
const listTabs = [
|
|
||||||
{
|
async function onChangeStatus({ statusId }: { statusId: string }) {
|
||||||
id: 1,
|
router.push(RouterEvent.status({ id: statusId }));
|
||||||
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",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tabs
|
<Tabs
|
||||||
variant="pills"
|
variant="pills"
|
||||||
radius="xl"
|
radius="xl"
|
||||||
mt={1}
|
mt={1}
|
||||||
defaultValue="Publish"
|
// defaultValue={"1"}
|
||||||
value={tabsStatus}
|
value={changeStatus}
|
||||||
onTabChange={setTabsStatus}
|
onTabChange={(val: any) => {
|
||||||
|
setChangeStatus(val);
|
||||||
|
onChangeStatus({ statusId: val });
|
||||||
|
}}
|
||||||
styles={{
|
styles={{
|
||||||
tabsList: {
|
tabsList: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
@@ -70,33 +53,95 @@ export default function Event_StatusPage({
|
|||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Tabs.List grow>
|
<Tabs.List grow>
|
||||||
{listTabs.map((e) => (
|
{listStatus.map((e) => (
|
||||||
<Tabs.Tab
|
<Tabs.Tab
|
||||||
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:
|
border:
|
||||||
tabsStatus === e.value
|
changeStatus === e.id
|
||||||
? `1px solid ${AccentColor.yellow}`
|
? `1px solid ${AccentColor.yellow}`
|
||||||
: `1px solid white`,
|
: `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}
|
{changeStatus === "1" && (
|
||||||
</Tabs.Panel>
|
<Event_StatusPublish listPublish={dataStatus} />
|
||||||
))}
|
)}
|
||||||
|
{changeStatus === "2" && (
|
||||||
|
<Event_StatusReview listReview={dataStatus} />
|
||||||
|
)}
|
||||||
|
{changeStatus === "3" && (
|
||||||
|
<Event_StatusDraft listDraft={dataStatus} />
|
||||||
|
)}
|
||||||
|
{changeStatus === "4" && (
|
||||||
|
<Event_StatusReject listReject={dataStatus} />
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Tabs>
|
</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>
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,18 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Center,
|
Center,
|
||||||
Group,
|
Loader
|
||||||
Loader,
|
|
||||||
Paper,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
} 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 _ 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 { ScrollOnly } from "next-scroll-loader";
|
||||||
import { useState } from "react";
|
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({
|
export default function Event_StatusReject({
|
||||||
listReject,
|
listReject,
|
||||||
|
|||||||
@@ -12,10 +12,8 @@ import { MODEL_EVENT } from "../../model/interface";
|
|||||||
|
|
||||||
export default function Event_StatusReview({
|
export default function Event_StatusReview({
|
||||||
listReview,
|
listReview,
|
||||||
|
|
||||||
}: {
|
}: {
|
||||||
listReview: MODEL_EVENT[];
|
listReview: MODEL_EVENT[];
|
||||||
|
|
||||||
}) {
|
}) {
|
||||||
const [data, setData] = useState(listReview);
|
const [data, setData] = useState(listReview);
|
||||||
const [activePage, setActivePage] = useState(1);
|
const [activePage, setActivePage] = useState(1);
|
||||||
|
|||||||
@@ -6,18 +6,16 @@ import { useShallowEffect } from "@mantine/hooks";
|
|||||||
import { IconPresentation } from "@tabler/icons-react";
|
import { IconPresentation } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
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() {
|
export default function Event_SplashScreen() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
|
const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
|
||||||
const [tabsStatus, setTabsStatus] = useAtom(gs_event_status);
|
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.replace(RouterEvent.beranda);
|
router.replace(RouterEvent.beranda);
|
||||||
setHotMenu(0);
|
setHotMenu(0);
|
||||||
setTabsStatus("Publish");
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function redirectEventPage({
|
|||||||
router: AppRouterInstance;
|
router: AppRouterInstance;
|
||||||
onSetPage: (val: any) => void;
|
onSetPage: (val: any) => void;
|
||||||
}) {
|
}) {
|
||||||
const path = RouterEvent.status_page;
|
const path = RouterEvent.status({id: ""});
|
||||||
|
|
||||||
if (data.status === "Publish") {
|
if (data.status === "Publish") {
|
||||||
onSetPage({
|
onSetPage({
|
||||||
|
|||||||
@@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
@@ -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());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user