fix: investasi:
deskripsi: fix penggunaan use server menjadi API - berita - detail [id] - src/app/dev/(user)/investasi/detail_ - src/app/dev/(user)/investasi/edit_ - src/app/dev/(user)/investasi/list_... - src/app/dev/(user)/investasi/main - src/app_modules/investasi/_ui - src/app_modules/investasi/_view/ - src/app_modules/investasi/berita/ - src/lib/router_hipmi/router_investasi No Issue
This commit is contained in:
@@ -1,12 +1,9 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import { Investasi_UiDetailBerita } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiDetailBerita } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Investasi_UiDetailBerita userLoginId={userLoginId} />
|
<Investasi_UiDetailBerita />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import { Investasi_UiDetailMain } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiDetailMain } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Investasi_UiDetailMain userLoginId={userLoginId as string} />
|
<Investasi_UiDetailMain />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
|
|
||||||
import { Investasi_UiDetailProspektus } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiDetailProspektus } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page() {
|
||||||
const investasiId = params.id;
|
|
||||||
const dataInvestasi = await investasi_funGetOneInvestasiById({ investasiId });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Investasi_UiDetailProspektus dataInvestasi={dataInvestasi} />
|
<Investasi_UiDetailProspektus />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import { investasi_funGetOneInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
|
|
||||||
import { Investasi_UiDetailSahamSaya } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiDetailSahamSaya } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page() {
|
||||||
const invoiceId = params.id;
|
|
||||||
// const dataSaham = await investasi_funGetOneInvoiceById({ invoiceId });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Investasi_UiDetailSahamSaya />
|
<Investasi_UiDetailSahamSaya />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { LayoutDetailBeritaInvestasi } from "@/app_modules/investasi";
|
import { LayoutDetailBeritaInvestasi } from "@/app_modules/investasi";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
// -- DELETE SOON -- //
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { DetailBeritaInvestasi } from "@/app_modules/investasi";
|
import { DetailBeritaInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneBeritaInvestasiById from "@/app_modules/investasi/fun/get_one_berita_by_id";
|
import getOneBeritaInvestasiById from "@/app_modules/investasi/fun/get_one_berita_by_id";
|
||||||
|
|
||||||
|
|
||||||
|
// -- DELETE SOON -- //
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const investasiId = params.id;
|
const investasiId = params.id;
|
||||||
const dataBerita = await getOneBeritaInvestasiById(investasiId);
|
const dataBerita = await getOneBeritaInvestasiById(investasiId);
|
||||||
// console.log(dataBerita)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -15,3 +16,4 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// -- DELETE SOON -- //
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// -- DELETE SOON -- //
|
||||||
import { DetailDokumenInvestasi } from "@/app_modules/investasi";
|
import { DetailDokumenInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// -- DELETE SOON -- //
|
||||||
import { LayoutDetailPropektus } from "@/app_modules/investasi";
|
import { LayoutDetailPropektus } from "@/app_modules/investasi";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DetailPropektus } from "@/app_modules/investasi";
|
import { DetailPropektus } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
// -- DELETE SOON -- //
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { LayoutEditBeritaInvestasi } from "@/app_modules/investasi";
|
import { LayoutEditBeritaInvestasi } from "@/app_modules/investasi";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
// -- DELETE SOON -- //
|
||||||
|
|
||||||
export default async function Layout({children}: { children: React.ReactNode }) {
|
export default async function Layout({children}: { children: React.ReactNode }) {
|
||||||
return<>
|
return<>
|
||||||
<LayoutEditBeritaInvestasi>{children}</LayoutEditBeritaInvestasi>
|
<LayoutEditBeritaInvestasi>{children}</LayoutEditBeritaInvestasi>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EditBeritaInvestasi } from "@/app_modules/investasi";
|
import { EditBeritaInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneBeritaInvestasiById from "@/app_modules/investasi/fun/get_one_berita_by_id";
|
import getOneBeritaInvestasiById from "@/app_modules/investasi/fun/get_one_berita_by_id";
|
||||||
|
// -- DELETE SOON -- //
|
||||||
export default async function Page({params}: {params: {id: string}}) {
|
export default async function Page({params}: {params: {id: string}}) {
|
||||||
const dataBerita = await getOneBeritaInvestasiById(params.id)
|
const dataBerita = await getOneBeritaInvestasiById(params.id)
|
||||||
// console.log(dataBerita)
|
// console.log(dataBerita)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// -- DELETE SOON -- //
|
||||||
import { LayoutEditIntroInvestasi } from "@/app_modules/investasi";
|
import { LayoutEditIntroInvestasi } from "@/app_modules/investasi";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// -- DELETE SOON -- //
|
||||||
|
|
||||||
import { EditIntroInvestasi } from "@/app_modules/investasi";
|
import { EditIntroInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
|
// -- DELETE Or UPDATE SOON -- //
|
||||||
|
|
||||||
import { LayoutListEditBeritaInvestasi } from "@/app_modules/investasi";
|
import { LayoutListEditBeritaInvestasi } from "@/app_modules/investasi";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
children,
|
children,
|
||||||
params
|
params,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutListEditBeritaInvestasi idInves={params.id}>{children}</LayoutListEditBeritaInvestasi>
|
<LayoutListEditBeritaInvestasi idInves={params.id}>
|
||||||
|
{children}
|
||||||
|
</LayoutListEditBeritaInvestasi>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// -- DELETE Or UPDATE SOON -- //
|
||||||
|
|
||||||
import { ListEditBeritaInvestasi } from "@/app_modules/investasi";
|
import { ListEditBeritaInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,8 @@
|
|||||||
import { Investasi_UiPortofolioNew } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiPortofolioNew } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page() {
|
||||||
// const statusId = params.id;
|
|
||||||
// const listStatus = await getStatusInvestasi();
|
|
||||||
// const dataPortofolio = await investasi_funGetPortofolioByStatusId({
|
|
||||||
// page: 1,
|
|
||||||
// statusId: statusId,
|
|
||||||
// });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <Investasi_UiPortofolio
|
|
||||||
statusId={statusId}
|
|
||||||
listStatus={listStatus as any}
|
|
||||||
dataPortofolio={dataPortofolio as any}
|
|
||||||
/> */}
|
|
||||||
<Investasi_UiPortofolioNew />
|
<Investasi_UiPortofolioNew />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
import { Investasi_ViewSahamSayaNew } from "@/app_modules/investasi/_view/main/view_saham_saya_new";
|
import { Investasi_ViewSahamSayaNew } from "@/app_modules/investasi/_view/main/view_saham_saya_new";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
// const dataSaham = await investasi_funGetSuccessTransactionById({ page: 1 });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <InvestasiSahamTerbeli listTransaksi={listTransaksi as any} /> */}
|
|
||||||
{/* <Investasi_UiSahamSaya dataSaham={dataSaham as any} /> */}
|
|
||||||
<Investasi_ViewSahamSayaNew />
|
<Investasi_ViewSahamSayaNew />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
import getListAllTransaksiById_Investasi from "@/app_modules/investasi/fun/get_list_all_transaksi_by_id";
|
|
||||||
import getMaster_StatusTransaksiInvestasi from "@/app_modules/investasi/fun/master/get_status_transaksi";
|
|
||||||
|
|
||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import { investasi_funGetTransaksiByUserId } from "@/app_modules/investasi/_fun";
|
|
||||||
import { Investasi_UiDaftarTransaksi } from "@/app_modules/investasi/_ui";
|
|
||||||
import { Investasi_ViewDaftarTransaksiNew } from "@/app_modules/investasi/_view/main/view_transaksi_new";
|
import { Investasi_ViewDaftarTransaksiNew } from "@/app_modules/investasi/_view/main/view_transaksi_new";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
// const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
|
||||||
// const listTransaksi = await getListAllTransaksiById_Investasi(
|
|
||||||
// userLoginId as string
|
|
||||||
// );
|
|
||||||
|
|
||||||
// NEW
|
|
||||||
// const dataTransaksi = await investasi_funGetTransaksiByUserId({ page: 1 });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <TransaksiInvestasi
|
|
||||||
statusTransaksi={statusTransaksi as any}
|
|
||||||
listTransaksi={listTransaksi as any}
|
|
||||||
/> */}
|
|
||||||
{/* <Investasi_UiDaftarTransaksi dataTransaksi={dataTransaksi} /> */}
|
|
||||||
<Investasi_ViewDaftarTransaksiNew/>
|
<Investasi_ViewDaftarTransaksiNew/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
|
|
||||||
import { Investasi_UiProsesPembelian } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiProsesPembelian } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page() {
|
||||||
const investasiId = params.id;
|
|
||||||
const dataInvestasi = await investasi_funGetOneInvestasiById({ investasiId });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Investasi_UiProsesPembelian dataInvestasi={dataInvestasi} />
|
<Investasi_UiProsesPembelian />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,9 @@ import UI_NewLayoutTamplate, {
|
|||||||
UI_NewHeader,
|
UI_NewHeader,
|
||||||
UI_NewChildren,
|
UI_NewChildren,
|
||||||
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
|
import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
|
||||||
|
|
||||||
export function Investasi_UiDetailBerita({
|
export function Investasi_UiDetailBerita() {
|
||||||
userLoginId,
|
|
||||||
}: {
|
|
||||||
userLoginId: string;
|
|
||||||
}) {
|
|
||||||
const params = useParams<{ id: string }>();
|
const params = useParams<{ id: string }>();
|
||||||
const id = params.id;
|
const id = params.id;
|
||||||
|
|
||||||
@@ -43,6 +40,25 @@ export function Investasi_UiDetailBerita({
|
|||||||
const [data, setData] = useState<any | null>(null);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const [userLoginId, setUserLoginId] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
handleGetUserId();
|
||||||
|
onLoadData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
async function handleGetUserId() {
|
||||||
|
try {
|
||||||
|
const respone = await apiNewGetUserIdByToken();
|
||||||
|
|
||||||
|
if (respone) {
|
||||||
|
setUserLoginId(respone.userId);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error get data detail", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, []);
|
}, []);
|
||||||
@@ -96,27 +112,6 @@ export function Investasi_UiDetailBerita({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <UIGlobal_LayoutTamplate
|
|
||||||
header={
|
|
||||||
<UIGlobal_LayoutHeaderTamplate
|
|
||||||
title="Detail Berita"
|
|
||||||
customButtonRight={
|
|
||||||
data && userLoginId === data.investasi.authorId ? (
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() => setOpenDrawer(true)}
|
|
||||||
>
|
|
||||||
<IconDotsVertical color="white" />
|
|
||||||
</ActionIcon>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Investasi_ViewDetailBerita />
|
|
||||||
</UIGlobal_LayoutTamplate> */}
|
|
||||||
|
|
||||||
<UI_NewLayoutTamplate>
|
<UI_NewLayoutTamplate>
|
||||||
<UI_NewHeader>
|
<UI_NewHeader>
|
||||||
|
|||||||
@@ -2,31 +2,47 @@
|
|||||||
|
|
||||||
import { MainColor } from "@/app_modules/_global/color";
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
|
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
|
||||||
import {
|
import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
|
||||||
UIGlobal_Drawer
|
import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
|
||||||
} from "@/app_modules/_global/ui";
|
import UI_NewLayoutTamplate, {
|
||||||
import UI_NewLayoutTamplate, { UI_NewChildren, UI_NewHeader } from "@/app_modules/_global/ui/V2_layout_tamplate";
|
UI_NewChildren,
|
||||||
import {
|
UI_NewHeader,
|
||||||
NEW_RouterInvestasi
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
} from "@/lib/router_hipmi/router_investasi";
|
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
||||||
import { ActionIcon } from "@mantine/core";
|
import { ActionIcon } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconCategoryPlus, IconDeviceIpadPlus, IconDotsVertical } from "@tabler/icons-react";
|
import {
|
||||||
import { useParams, useRouter } from "next/navigation";
|
IconCategoryPlus,
|
||||||
|
IconDeviceIpadPlus,
|
||||||
|
IconDotsVertical,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
|
import { useParams } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
|
import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
|
||||||
import { MODEL_INVESTASI } from "../../_lib/interface";
|
import { MODEL_INVESTASI } from "../../_lib/interface";
|
||||||
import { Investasi_ViewDetailPublish } from "../../_view";
|
import { Investasi_ViewDetailPublish } from "../../_view";
|
||||||
|
|
||||||
export function Investasi_UiDetailMain({
|
export function Investasi_UiDetailMain() {
|
||||||
userLoginId,
|
|
||||||
}: {
|
|
||||||
userLoginId: string;
|
|
||||||
}) {
|
|
||||||
const param = useParams<{ id: string }>();
|
const param = useParams<{ id: string }>();
|
||||||
const router = useRouter();
|
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
const [data, setData] = useState<MODEL_INVESTASI | null>(null);
|
const [data, setData] = useState<MODEL_INVESTASI | null>(null);
|
||||||
|
const [userLoginId, setUserLoginId] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
handleGetUserId();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
async function handleGetUserId() {
|
||||||
|
try {
|
||||||
|
const respone = await apiNewGetUserIdByToken();
|
||||||
|
|
||||||
|
if (respone) {
|
||||||
|
setUserLoginId(respone.userId);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error get data detail", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
handleLoadData();
|
handleLoadData();
|
||||||
@@ -85,36 +101,11 @@ export function Investasi_UiDetailMain({
|
|||||||
<UI_NewChildren>
|
<UI_NewChildren>
|
||||||
<Investasi_ViewDetailPublish
|
<Investasi_ViewDetailPublish
|
||||||
data={data as any}
|
data={data as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</UI_NewChildren>
|
</UI_NewChildren>
|
||||||
</UI_NewLayoutTamplate>
|
</UI_NewLayoutTamplate>
|
||||||
|
|
||||||
{/* <UIGlobal_LayoutTamplate
|
|
||||||
header={
|
|
||||||
<UIGlobal_LayoutHeaderTamplate
|
|
||||||
title="Detail "
|
|
||||||
customButtonRight={
|
|
||||||
userLoginId === data?.authorId ? (
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() => setOpenDrawer(true)}
|
|
||||||
>
|
|
||||||
<IconDotsVertical color={MainColor.white} />
|
|
||||||
</ActionIcon>
|
|
||||||
) : (
|
|
||||||
<ActionIcon disabled variant="transparent" />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Investasi_ViewDetailPublish
|
|
||||||
data={data as any}
|
|
||||||
userLoginId={userLoginId}
|
|
||||||
/>
|
|
||||||
</UIGlobal_LayoutTamplate> */}
|
|
||||||
|
|
||||||
<UIGlobal_Drawer
|
<UIGlobal_Drawer
|
||||||
opened={openDrawer}
|
opened={openDrawer}
|
||||||
close={() => setOpenDrawer(false)}
|
close={() => setOpenDrawer(false)}
|
||||||
|
|||||||
@@ -7,25 +7,15 @@ import UI_NewLayoutTamplate, {
|
|||||||
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
import { Investasi_ViewDetailProspektus } from "../../_view";
|
import { Investasi_ViewDetailProspektus } from "../../_view";
|
||||||
|
|
||||||
export function Investasi_UiDetailProspektus({
|
export function Investasi_UiDetailProspektus() {
|
||||||
dataInvestasi,
|
|
||||||
}: {
|
|
||||||
dataInvestasi: any;
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <UIGlobal_LayoutTamplate
|
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Detail Prospektus" />}
|
|
||||||
>
|
|
||||||
<Investasi_ViewDetailProspektus dataInvestasi={dataInvestasi} />
|
|
||||||
</UIGlobal_LayoutTamplate> */}
|
|
||||||
|
|
||||||
<UI_NewLayoutTamplate>
|
<UI_NewLayoutTamplate>
|
||||||
<UI_NewHeader>
|
<UI_NewHeader>
|
||||||
<Component_Header title="Detail Prospektus" />
|
<Component_Header title="Detail Prospektus" />
|
||||||
</UI_NewHeader>
|
</UI_NewHeader>
|
||||||
<UI_NewChildren>
|
<UI_NewChildren>
|
||||||
<Investasi_ViewDetailProspektus dataInvestasi={dataInvestasi} />
|
<Investasi_ViewDetailProspektus />
|
||||||
</UI_NewChildren>
|
</UI_NewChildren>
|
||||||
</UI_NewLayoutTamplate>
|
</UI_NewLayoutTamplate>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -7,25 +7,16 @@ import UI_NewLayoutTamplate, {
|
|||||||
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
import { Investasi_ViewProsesPembelian } from "../../_view";
|
import { Investasi_ViewProsesPembelian } from "../../_view";
|
||||||
|
|
||||||
export function Investasi_UiProsesPembelian({
|
export function Investasi_UiProsesPembelian() {
|
||||||
dataInvestasi,
|
|
||||||
}: {
|
|
||||||
dataInvestasi: any;
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <UIGlobal_LayoutTamplate
|
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Pembelian Saham" />}
|
|
||||||
>
|
|
||||||
<Investasi_ViewProsesPembelian dataInvestasi={dataInvestasi} />
|
|
||||||
</UIGlobal_LayoutTamplate> */}
|
|
||||||
|
|
||||||
<UI_NewLayoutTamplate>
|
<UI_NewLayoutTamplate>
|
||||||
<UI_NewHeader>
|
<UI_NewHeader>
|
||||||
<Component_Header title="Pembelian Saham" />
|
<Component_Header title="Pembelian Saham" />
|
||||||
</UI_NewHeader>
|
</UI_NewHeader>
|
||||||
<UI_NewChildren>
|
<UI_NewChildren>
|
||||||
<Investasi_ViewProsesPembelian dataInvestasi={dataInvestasi} />
|
<Investasi_ViewProsesPembelian />
|
||||||
</UI_NewChildren>
|
</UI_NewChildren>
|
||||||
</UI_NewLayoutTamplate>
|
</UI_NewLayoutTamplate>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
import {
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
|
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
@@ -13,6 +15,7 @@ import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
|||||||
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
|
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
|
||||||
import funDeleteInvestasi from "@/app_modules/investasi/fun/fun_delete_investasi";
|
import funDeleteInvestasi from "@/app_modules/investasi/fun/fun_delete_investasi";
|
||||||
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 { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import { Button, Group, Stack } from "@mantine/core";
|
import { Button, Group, Stack } from "@mantine/core";
|
||||||
@@ -35,17 +38,16 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
const [openModalDelete, setOpenModalDelete] = useState(false);
|
const [openModalDelete, setOpenModalDelete] = useState(false);
|
||||||
|
|
||||||
async function onChangeStatus() {
|
async function onChangeStatus() {
|
||||||
const res = await investasi_funEditStatusById({
|
|
||||||
investasiId: data.id,
|
|
||||||
statusId: "2",
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
const res = await investasi_funEditStatusById({
|
||||||
|
investasiId: data.id,
|
||||||
|
statusId: "2",
|
||||||
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil("Review Berhasil Diajukan");
|
ComponentGlobal_NotifikasiBerhasil("Review Berhasil Diajukan");
|
||||||
router.replace(NEW_RouterInvestasi.portofolio({ id: "2" }));
|
router.replace(NEW_RouterInvestasi.portofolio({ id: "2" }));
|
||||||
|
|
||||||
const dataNotif = {
|
const dataNotif = {
|
||||||
appId: res.data?.id,
|
appId: res.data?.id,
|
||||||
userId: res.data?.authorId,
|
userId: res.data?.authorId,
|
||||||
@@ -54,11 +56,11 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
kategoriApp: "INVESTASI",
|
kategoriApp: "INVESTASI",
|
||||||
title: "Mengajukan review",
|
title: "Mengajukan review",
|
||||||
};
|
};
|
||||||
|
|
||||||
const notif = await notifikasiToAdmin_funCreate({
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
data: dataNotif as any,
|
data: dataNotif as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (notif.status === 201) {
|
if (notif.status === 201) {
|
||||||
mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
|
mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
|
||||||
}
|
}
|
||||||
@@ -73,31 +75,30 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
const res = await funDeleteInvestasi(data.id);
|
|
||||||
try {
|
try {
|
||||||
setIsLoadingDelete(true);
|
setIsLoadingDelete(true);
|
||||||
|
const res = await funDeleteInvestasi(data.id);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|
||||||
const delImage = await funGlobal_DeleteFileById({
|
const delImage = await funGlobal_DeleteFileById({
|
||||||
fileId: data.imageId,
|
fileId: data.imageId,
|
||||||
});
|
});
|
||||||
if (!delImage.success) {
|
if (!delImage.success) {
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
|
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
|
||||||
}
|
}
|
||||||
|
|
||||||
const delFileProspektus = await funGlobal_DeleteFileById({
|
const delFileProspektus = await funGlobal_DeleteFileById({
|
||||||
fileId: data.prospektusFileId,
|
fileId: data.prospektusFileId,
|
||||||
});
|
});
|
||||||
if (!delFileProspektus.success) {
|
if (!delFileProspektus.success) {
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
|
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isEmpty(data.DokumenInvestasi)) {
|
if (!_.isEmpty(data.DokumenInvestasi)) {
|
||||||
for (let i of data.DokumenInvestasi) {
|
for (let i of data.DokumenInvestasi) {
|
||||||
const delFileDokumen = await funGlobal_DeleteFileById({
|
const delFileDokumen = await funGlobal_DeleteFileById({
|
||||||
fileId: i.fileId,
|
fileId: i.fileId,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!delFileDokumen.success) {
|
if (!delFileDokumen.success) {
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
ComponentAdminGlobal_NotifikasiPeringatan(
|
||||||
"Gagal hapus prospektus "
|
"Gagal hapus prospektus "
|
||||||
@@ -105,7 +106,7 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setOpenModal(false);
|
setOpenModal(false);
|
||||||
router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
|
router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
|
||||||
@@ -131,7 +132,7 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
<Group position="apart" grow>
|
<Group position="apart" grow>
|
||||||
<Button
|
<Button
|
||||||
radius={50}
|
radius={50}
|
||||||
style={{ backgroundColor: AccentColor.yellow}}
|
style={{ backgroundColor: AccentColor.yellow }}
|
||||||
c={MainColor.darkblue}
|
c={MainColor.darkblue}
|
||||||
onClick={() => setOpenModal(true)}
|
onClick={() => setOpenModal(true)}
|
||||||
>
|
>
|
||||||
@@ -140,7 +141,7 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
radius={50}
|
radius={50}
|
||||||
style={{ backgroundColor: MainColor.red}}
|
style={{ backgroundColor: MainColor.red }}
|
||||||
c={AccentColor.white}
|
c={AccentColor.white}
|
||||||
onClick={() => setOpenModalDelete(true)}
|
onClick={() => setOpenModalDelete(true)}
|
||||||
>
|
>
|
||||||
@@ -155,15 +156,20 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
close={() => setOpenModal(false)}
|
close={() => setOpenModal(false)}
|
||||||
title={"Anda yakin ingin mengajukan review ?"}
|
title={"Anda yakin ingin mengajukan review ?"}
|
||||||
buttonKiri={
|
buttonKiri={
|
||||||
<Button style={{ backgroundColor: AccentColor.blue }}
|
<Button
|
||||||
c={AccentColor.white} radius={"xl"} onClick={() => setOpenModal(false)}>
|
style={{ backgroundColor: AccentColor.blue }}
|
||||||
|
c={AccentColor.white}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => setOpenModal(false)}
|
||||||
|
>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
buttonKanan={
|
buttonKanan={
|
||||||
<Button
|
<Button
|
||||||
style={{
|
style={{
|
||||||
transition: "0.5s", color: "black",
|
transition: "0.5s",
|
||||||
|
color: "black",
|
||||||
backgroundColor: AccentColor.yellow,
|
backgroundColor: AccentColor.yellow,
|
||||||
}}
|
}}
|
||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
@@ -183,8 +189,12 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
close={() => setOpenModalDelete(false)}
|
close={() => setOpenModalDelete(false)}
|
||||||
title={"Anda yakin ingin menghapus ?"}
|
title={"Anda yakin ingin menghapus ?"}
|
||||||
buttonKiri={
|
buttonKiri={
|
||||||
<Button style={{ backgroundColor: AccentColor.blue }}
|
<Button
|
||||||
c={AccentColor.white} radius={"xl"} onClick={() => setOpenModalDelete(false)}>
|
style={{ backgroundColor: AccentColor.blue }}
|
||||||
|
c={AccentColor.white}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => setOpenModalDelete(false)}
|
||||||
|
>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
@@ -192,7 +202,7 @@ export default function Investasi_ViewDetailDraft({
|
|||||||
<Button
|
<Button
|
||||||
style={{
|
style={{
|
||||||
transition: "0.5s",
|
transition: "0.5s",
|
||||||
backgroundColor: MainColor.red
|
backgroundColor: MainColor.red,
|
||||||
}}
|
}}
|
||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
loading={isLoadingDelete}
|
loading={isLoadingDelete}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
|
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
|
||||||
@@ -12,6 +11,7 @@ import { Investasi_ComponentDetailDataNonPublish } from "@/app_modules/investasi
|
|||||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||||
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
|
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
|
||||||
import funDeleteInvestasi from "@/app_modules/investasi/fun/fun_delete_investasi";
|
import funDeleteInvestasi from "@/app_modules/investasi/fun/fun_delete_investasi";
|
||||||
|
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import { Button, Group, Stack } from "@mantine/core";
|
import { Button, Group, Stack } from "@mantine/core";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -31,65 +31,67 @@ export default function Investasi_ViewDetailReject({
|
|||||||
const [isLoadingEdit, setLoadingEdit] = useState(false);
|
const [isLoadingEdit, setLoadingEdit] = useState(false);
|
||||||
|
|
||||||
async function onAjukan() {
|
async function onAjukan() {
|
||||||
const res = await investasi_funEditStatusById({
|
|
||||||
investasiId: data.id,
|
|
||||||
statusId: "3",
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setLoadingEdit(true);
|
setLoadingEdit(true);
|
||||||
|
const res = await investasi_funEditStatusById({
|
||||||
|
investasiId: data.id,
|
||||||
|
statusId: "3",
|
||||||
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil("Project Diajukan Kembali");
|
ComponentGlobal_NotifikasiBerhasil("Project Diajukan Kembali");
|
||||||
router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
|
router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
|
||||||
} else {
|
} else {
|
||||||
setLoadingEdit(false);
|
|
||||||
ComponentGlobal_NotifikasiGagal("Gagal Pengajuan");
|
ComponentGlobal_NotifikasiGagal("Gagal Pengajuan");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setLoadingEdit(false);
|
|
||||||
clientLogger.error("Error ajukan kembali", error);
|
clientLogger.error("Error ajukan kembali", error);
|
||||||
|
} finally {
|
||||||
|
setLoadingEdit(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
const res = await funDeleteInvestasi(data.id);
|
try {
|
||||||
if (res.status === 200) {
|
|
||||||
setLoadingDel(true);
|
setLoadingDel(true);
|
||||||
|
const res = await funDeleteInvestasi(data.id);
|
||||||
|
if (res.status === 200) {
|
||||||
|
const delImage = await funGlobal_DeleteFileById({
|
||||||
|
fileId: data.imageId,
|
||||||
|
});
|
||||||
|
if (!delImage.success) {
|
||||||
|
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
|
||||||
|
}
|
||||||
|
|
||||||
const delImage = await funGlobal_DeleteFileById({
|
const delFileProspektus = await funGlobal_DeleteFileById({
|
||||||
fileId: data.imageId,
|
fileId: data.prospektusFileId,
|
||||||
});
|
});
|
||||||
if (!delImage.success) {
|
if (!delFileProspektus.success) {
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
|
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
|
||||||
}
|
}
|
||||||
|
|
||||||
const delFileProspektus = await funGlobal_DeleteFileById({
|
if (!_.isEmpty(data.DokumenInvestasi)) {
|
||||||
fileId: data.prospektusFileId,
|
for (let i of data.DokumenInvestasi) {
|
||||||
});
|
const delFileDokumen = await funGlobal_DeleteFileById({
|
||||||
if (!delFileProspektus.success) {
|
fileId: i.fileId,
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (!_.isEmpty(data.DokumenInvestasi)) {
|
if (!delFileDokumen.success) {
|
||||||
for (let i of data.DokumenInvestasi) {
|
ComponentAdminGlobal_NotifikasiPeringatan(
|
||||||
const delFileDokumen = await funGlobal_DeleteFileById({
|
"Gagal hapus prospektus "
|
||||||
fileId: i.fileId,
|
);
|
||||||
});
|
}
|
||||||
|
|
||||||
if (!delFileDokumen.success) {
|
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
|
||||||
"Gagal hapus prospektus "
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setOpenModalDel(false);
|
setOpenModalDel(false);
|
||||||
router.replace(NEW_RouterInvestasi.portofolio({ id: "4" }));
|
router.replace(NEW_RouterInvestasi.portofolio({ id: "4" }));
|
||||||
setLoadingDel(false);
|
} else {
|
||||||
} else {
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error delete investasi", error);
|
||||||
|
} finally {
|
||||||
setLoadingDel(false);
|
setLoadingDel(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,8 +104,12 @@ export default function Investasi_ViewDetailReject({
|
|||||||
opened={openModalDel}
|
opened={openModalDel}
|
||||||
close={() => setOpenModalDel(false)}
|
close={() => setOpenModalDel(false)}
|
||||||
buttonKiri={
|
buttonKiri={
|
||||||
<Button style={{ backgroundColor: AccentColor.blue }}
|
<Button
|
||||||
c={AccentColor.white} radius={"xl"} onClick={() => setOpenModalDel(false)}>
|
style={{ backgroundColor: AccentColor.blue }}
|
||||||
|
c={AccentColor.white}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => setOpenModalDel(false)}
|
||||||
|
>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
@@ -112,7 +118,7 @@ export default function Investasi_ViewDetailReject({
|
|||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
loading={isLoadingDel}
|
loading={isLoadingDel}
|
||||||
c={AccentColor.white}
|
c={AccentColor.white}
|
||||||
style={{ backgroundColor: MainColor.red}}
|
style={{ backgroundColor: MainColor.red }}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => onDelete()}
|
onClick={() => onDelete()}
|
||||||
>
|
>
|
||||||
@@ -126,8 +132,12 @@ export default function Investasi_ViewDetailReject({
|
|||||||
opened={openModalEdit}
|
opened={openModalEdit}
|
||||||
close={() => setOpenModalEdit(false)}
|
close={() => setOpenModalEdit(false)}
|
||||||
buttonKiri={
|
buttonKiri={
|
||||||
<Button style={{ backgroundColor: AccentColor.blue }}
|
<Button
|
||||||
c={AccentColor.white} radius={"xl"} onClick={() => setOpenModalEdit(false)}>
|
style={{ backgroundColor: AccentColor.blue }}
|
||||||
|
c={AccentColor.white}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => setOpenModalEdit(false)}
|
||||||
|
>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,16 +26,16 @@ export default function Investasi_ViewDetailReview({
|
|||||||
const [openModal, setOpenModal] = useState(false);
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
|
||||||
async function onChangeStatus() {
|
async function onChangeStatus() {
|
||||||
const res = await investasi_funEditStatusById({
|
|
||||||
investasiId: data.id,
|
|
||||||
statusId: "3",
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
const res = await investasi_funEditStatusById({
|
||||||
|
investasiId: data.id,
|
||||||
|
statusId: "3",
|
||||||
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil("Review Dibatalkan");
|
ComponentGlobal_NotifikasiBerhasil("Review Dibatalkan");
|
||||||
router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
|
router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
|
||||||
|
|
||||||
const dataNotif = {
|
const dataNotif = {
|
||||||
appId: res.data?.id,
|
appId: res.data?.id,
|
||||||
userId: res.data?.authorId,
|
userId: res.data?.authorId,
|
||||||
@@ -44,11 +44,11 @@ export default function Investasi_ViewDetailReview({
|
|||||||
kategoriApp: "INVESTASI",
|
kategoriApp: "INVESTASI",
|
||||||
title: "Membatalkan review",
|
title: "Membatalkan review",
|
||||||
};
|
};
|
||||||
|
|
||||||
const notif = await notifikasiToAdmin_funCreate({
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
data: dataNotif as any,
|
data: dataNotif as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (notif.status === 201) {
|
if (notif.status === 201) {
|
||||||
mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
|
mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
|
||||||
}
|
}
|
||||||
@@ -88,16 +88,21 @@ export default function Investasi_ViewDetailReview({
|
|||||||
close={() => setOpenModal(false)}
|
close={() => setOpenModal(false)}
|
||||||
title={"Anda yakin ingin batalkan review?"}
|
title={"Anda yakin ingin batalkan review?"}
|
||||||
buttonKiri={
|
buttonKiri={
|
||||||
<Button style={{ backgroundColor: AccentColor.blue }}
|
<Button
|
||||||
c={AccentColor.white} radius={"xl"} onClick={() => setOpenModal(false)}>
|
style={{ backgroundColor: AccentColor.blue }}
|
||||||
|
c={AccentColor.white}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => setOpenModal(false)}
|
||||||
|
>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
buttonKanan={
|
buttonKanan={
|
||||||
<Button
|
<Button
|
||||||
style={{
|
style={{
|
||||||
transition: "0.5s", color: "black",
|
transition: "0.5s",
|
||||||
backgroundColor: AccentColor.yellow
|
color: "black",
|
||||||
|
backgroundColor: AccentColor.yellow,
|
||||||
}}
|
}}
|
||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
|
|||||||
@@ -1,30 +1,52 @@
|
|||||||
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
|
||||||
import { MainColor } from "@/app_modules/_global/color";
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_CardLoadingOverlay,
|
ComponentGlobal_CardLoadingOverlay,
|
||||||
ComponentGlobal_CardStyles,
|
ComponentGlobal_CardStyles,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
|
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||||
|
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
||||||
import { Center, Group, Text } from "@mantine/core";
|
import { Center, Group, Text } from "@mantine/core";
|
||||||
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconFileTypePdf } from "@tabler/icons-react";
|
import { IconFileTypePdf } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
|
||||||
import { MODEL_INVESTASI } from "../../_lib/interface";
|
import { MODEL_INVESTASI } from "../../_lib/interface";
|
||||||
|
|
||||||
export function Investasi_ViewDetailProspektus({
|
export function Investasi_ViewDetailProspektus() {
|
||||||
dataInvestasi,
|
const param = useParams<{ id: string }>();
|
||||||
}: {
|
|
||||||
dataInvestasi: MODEL_INVESTASI;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
||||||
|
const [dataInvestasi, setDataInvestasi] = useState<MODEL_INVESTASI | null>(
|
||||||
|
null
|
||||||
|
);
|
||||||
|
useShallowEffect(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
async function onLoadData() {
|
||||||
|
try {
|
||||||
|
const response = await apiNewGetOneInvestasiById({ id: param.id });
|
||||||
|
if (response.success) {
|
||||||
|
setDataInvestasi(response.data);
|
||||||
|
} else {
|
||||||
|
setDataInvestasi(null);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dataInvestasi) return <CustomSkeleton height={"80vh"} width={"100%"} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ComponentGlobal_CardStyles
|
<ComponentGlobal_CardStyles
|
||||||
onClickHandler={() => {
|
onClickHandler={() => {
|
||||||
router.push(
|
router.push(
|
||||||
NEW_RouterInvestasi.file_prospektus({
|
NEW_RouterInvestasi.file_prospektus({
|
||||||
id: dataInvestasi.prospektusFileId,
|
id: dataInvestasi?.prospektusFileId,
|
||||||
}),
|
}),
|
||||||
{ scroll: false }
|
{ scroll: false }
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ export function Investasi_ViewEditDokumen() {
|
|||||||
ComponentGlobal_NotifikasiPeringatan(updateNoFile.message);
|
ComponentGlobal_NotifikasiPeringatan(updateNoFile.message);
|
||||||
}
|
}
|
||||||
ComponentGlobal_NotifikasiBerhasil(updateNoFile.message);
|
ComponentGlobal_NotifikasiBerhasil(updateNoFile.message);
|
||||||
|
router.back();
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -11,23 +11,24 @@ import {
|
|||||||
NumberInput,
|
NumberInput,
|
||||||
Text,
|
Text,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useFocusTrap, useLocalStorage } from "@mantine/hooks";
|
import {
|
||||||
import { useAtom } from "jotai";
|
useFocusTrap,
|
||||||
import { useRouter } from "next/navigation";
|
useLocalStorage,
|
||||||
|
useShallowEffect,
|
||||||
|
} from "@mantine/hooks";
|
||||||
|
import { useParams, useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { NEW_RouterInvestasi } from "../../../../lib/router_hipmi/router_investasi";
|
import { NEW_RouterInvestasi } from "../../../../lib/router_hipmi/router_investasi";
|
||||||
|
import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
|
||||||
import { MODEL_INVESTASI } from "../../_lib/interface";
|
import { MODEL_INVESTASI } from "../../_lib/interface";
|
||||||
import { gs_investas_menu } from "../../g_state";
|
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||||
|
|
||||||
export function Investasi_ViewProsesPembelian({
|
export function Investasi_ViewProsesPembelian() {
|
||||||
dataInvestasi,
|
const param = useParams<{ id: string }>();
|
||||||
}: {
|
|
||||||
dataInvestasi: MODEL_INVESTASI;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const focusTrapRef = useFocusTrap();
|
const focusTrapRef = useFocusTrap();
|
||||||
const [data, setData] = useState(dataInvestasi);
|
const [data, setData] = useState<MODEL_INVESTASI | null>(null);
|
||||||
const [maxPembelian, setMaxPembelian] = useState(Number(data.sisaLembar));
|
const [maxPembelian, setMaxPembelian] = useState<number>(0);
|
||||||
const [total, setTotal] = useLocalStorage({
|
const [total, setTotal] = useLocalStorage({
|
||||||
key: "total_investasi",
|
key: "total_investasi",
|
||||||
defaultValue: 0,
|
defaultValue: 0,
|
||||||
@@ -38,6 +39,32 @@ export function Investasi_ViewProsesPembelian({
|
|||||||
});
|
});
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
handleLoadData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiNewGetOneInvestasiById({ id: param.id });
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
setMaxPembelian(Number(response.data.sisaLembar));
|
||||||
|
} else {
|
||||||
|
setData(null);
|
||||||
|
setMaxPembelian(0);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error get investasi", error);
|
||||||
|
setData(null);
|
||||||
|
setMaxPembelian(0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return <CustomSkeleton height={400} />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box
|
<Box
|
||||||
@@ -120,7 +147,7 @@ export function Investasi_ViewProsesPembelian({
|
|||||||
router.push(NEW_RouterInvestasi.metode_pembayaran + data.id, {
|
router.push(NEW_RouterInvestasi.metode_pembayaran + data.id, {
|
||||||
scroll: false,
|
scroll: false,
|
||||||
});
|
});
|
||||||
setIsLoading(true)
|
setIsLoading(true);
|
||||||
}}
|
}}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import _ from "lodash";
|
|||||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
|
|
||||||
|
// -- DELETE SOON -- //
|
||||||
export default function BeritaInvestasi({
|
export default function BeritaInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@@ -155,7 +155,11 @@ export const RouterInvestasi_OLD = {
|
|||||||
detail_saham_terbeli: "/dev/investasi/detail_saham_terbeli/",
|
detail_saham_terbeli: "/dev/investasi/detail_saham_terbeli/",
|
||||||
detail_prospektus: "/dev/investasi/detail_prospektus/",
|
detail_prospektus: "/dev/investasi/detail_prospektus/",
|
||||||
detail_dokumen: "/dev/investasi/detail_dokumen/",
|
detail_dokumen: "/dev/investasi/detail_dokumen/",
|
||||||
|
|
||||||
|
// -- DELETE SOON -- //
|
||||||
detail_berita: "/dev/investasi/detail_berita/",
|
detail_berita: "/dev/investasi/detail_berita/",
|
||||||
|
// -- DELETE SOON -- //
|
||||||
|
|
||||||
detail_draft: "/dev/investasi/detail_portofolio/draft/",
|
detail_draft: "/dev/investasi/detail_portofolio/draft/",
|
||||||
detail_publish: "/dev/investasi/detail_portofolio/publish/",
|
detail_publish: "/dev/investasi/detail_portofolio/publish/",
|
||||||
detail_review: "/dev/investasi/detail_portofolio/review/",
|
detail_review: "/dev/investasi/detail_portofolio/review/",
|
||||||
|
|||||||
Reference in New Issue
Block a user