Admin Investasi
# feat: - Ganti status dan reject ### No issue
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
import { Admin_LayoutKonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default async function Layout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Admin_LayoutKonfirmasiInvestasi>
|
|
||||||
{children}
|
|
||||||
</Admin_LayoutKonfirmasiInvestasi>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
export const RouterAdminDashboard = {
|
export const RouterAdminDashboard = {
|
||||||
main_admin: "/dev/admin/main/dashboard",
|
main_admin: "/dev/admin/main/dashboard",
|
||||||
splash_admin: "/dev/admin/splash",
|
splash_admin: "/dev/splash/admin",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RouterAdminInvestasi = {
|
export const RouterAdminInvestasi = {
|
||||||
main_investasi: "/dev/admin/main/investasi",
|
main_investasi: "/dev/admin/investasi/main",
|
||||||
halaman_aksi: "/dev/admin/investasi/halaman_aksi/",
|
halaman_aksi: "/dev/admin/investasi/halaman_aksi/",
|
||||||
konfirmasi: "/dev/admin/investasi/konfirmasi/",
|
konfirmasi: "/dev/admin/investasi/konfirmasi/",
|
||||||
bukti_transfer: "/dev/admin/investasi/bukti_transfer",
|
bukti_transfer: "/dev/admin/investasi/bukti_transfer",
|
||||||
@@ -12,5 +12,5 @@ export const RouterAdminInvestasi = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const RouterAdminAward = {
|
export const RouterAdminAward = {
|
||||||
main_award: "/dev/admin/main/award",
|
main_award: "/dev/admin/award/main",
|
||||||
};
|
};
|
||||||
|
|||||||
21
src/app_modules/admin/investasi/fun/fun_reject_investasi.ts
Normal file
21
src/app_modules/admin/investasi/fun/fun_reject_investasi.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
"use server"
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma"
|
||||||
|
|
||||||
|
export default async function funRejectInvestasi(data: any) {
|
||||||
|
// console.log(data)
|
||||||
|
|
||||||
|
const res = await prisma.investasi.update({
|
||||||
|
where: { id: data.id },
|
||||||
|
data: {
|
||||||
|
masterStatusInvestasiId: data.status,
|
||||||
|
catatan: data.catatan
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(!res) return {status: 400, message: "Gagal reject"}
|
||||||
|
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
|
message: "Reject berhasil"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ export default async function Admin_funGetAllInvestasi() {
|
|||||||
roi: true,
|
roi: true,
|
||||||
active: true,
|
active: true,
|
||||||
imagesId: true,
|
imagesId: true,
|
||||||
|
catatan: true,
|
||||||
MasterStatusInvestasi: true,
|
MasterStatusInvestasi: true,
|
||||||
BeritaInvestasi: true,
|
BeritaInvestasi: true,
|
||||||
DokumenInvestasi: true,
|
DokumenInvestasi: true,
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
|
import funRejectInvestasi from "../fun/fun_reject_investasi";
|
||||||
|
|
||||||
export default function Admin_KonfirmasiInvestasi({
|
export default function Admin_KonfirmasiInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
@@ -89,23 +90,33 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
// cekStatusPublish()
|
cekStatusPublish();
|
||||||
// },[])
|
}, []);
|
||||||
|
|
||||||
// async function cekStatusPublish() {
|
async function cekStatusPublish() {
|
||||||
// if(investasi.MasterStatusInvestasi.id === "3")
|
if (investasi.MasterStatusInvestasi.id === "3") setPublish(false);
|
||||||
// setPublish(false)
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
async function onCatatan() {
|
async function onReject() {
|
||||||
if (_.isEmpty(catatan)) return toast("Lengkapi alasan");
|
const body = {
|
||||||
console.log(catatan);
|
id: investasi.id,
|
||||||
toggle();
|
catatan: catatan,
|
||||||
|
status: "4",
|
||||||
|
};
|
||||||
|
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
||||||
|
await funRejectInvestasi(body).then((res) => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
toast(res.message);
|
||||||
|
toggle();
|
||||||
|
} else {
|
||||||
|
toast(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onPublish() {
|
async function onPublish() {
|
||||||
// const res = await funGantiStatusInvestasi(investasi.id, "3")
|
const res = await funGantiStatusInvestasi(investasi.id, "3");
|
||||||
setTimeout(() => setPublish(false), 1000);
|
setTimeout(() => setPublish(false), 1000);
|
||||||
toast("Proyek Investasi Di Publish");
|
toast("Proyek Investasi Di Publish");
|
||||||
}
|
}
|
||||||
@@ -113,20 +124,28 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Group position="apart" px={"md"}>
|
<Group position="apart" px={"md"}>
|
||||||
<Flex align={"center"} gap={"xs"}>
|
<Group>
|
||||||
<Avatar
|
<ActionIcon onClick={() => router.back()}>
|
||||||
radius={50}
|
<IconChevronLeft />
|
||||||
size={"lg"}
|
</ActionIcon>
|
||||||
src={
|
<Flex align={"center"} gap={"xs"} pl={"lg"}>
|
||||||
RouterUserProfile.api_foto + `${user.Profile?.ImageProfile?.url}`
|
<Avatar
|
||||||
}
|
radius={50}
|
||||||
/>
|
size={"md"}
|
||||||
<Text>{user.username}</Text>
|
src={
|
||||||
</Flex>
|
RouterUserProfile.api_foto +
|
||||||
|
`${user.Profile?.ImageProfile?.url}`
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Text>{user.username}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
{" "}
|
{" "}
|
||||||
<Center>
|
<Center>
|
||||||
{publish ? (
|
{!publish || investasi.MasterStatusInvestasi.id === "4" ? (
|
||||||
|
""
|
||||||
|
) : (
|
||||||
<Button
|
<Button
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={"green"}
|
bg={"green"}
|
||||||
@@ -138,30 +157,33 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
>
|
>
|
||||||
Publish
|
Publish
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
// <Button
|
||||||
<Button
|
// radius={50}
|
||||||
radius={50}
|
// leftIcon={<IconBan />}
|
||||||
leftIcon={<IconBan />}
|
// bg={"orange"}
|
||||||
bg={"orange"}
|
// color="orange"
|
||||||
color="orange"
|
// onClick={() => {
|
||||||
onClick={() => {
|
// setTimeout(() => setPublish(true), 1000);
|
||||||
setTimeout(() => setPublish(true), 1000);
|
// toast("Proyek Investasi Di Non-Aktifkan");
|
||||||
toast("Proyek Investasi Di Non-Aktifkan");
|
// }}
|
||||||
}}
|
// >
|
||||||
>
|
// Non - aktifkan
|
||||||
Non - aktifkan
|
// </Button>
|
||||||
</Button>
|
|
||||||
)}
|
)}
|
||||||
</Center>
|
</Center>
|
||||||
<Button
|
{investasi.MasterStatusInvestasi.id === "3" ? (
|
||||||
radius={50}
|
""
|
||||||
bg={"red"}
|
) : (
|
||||||
color="red"
|
<Button
|
||||||
onClick={toggle}
|
radius={50}
|
||||||
rightIcon={<IconAlertHexagonFilled />}
|
bg={"red"}
|
||||||
>
|
color="red"
|
||||||
Reject
|
onClick={toggle}
|
||||||
</Button>
|
rightIcon={<IconAlertHexagonFilled />}
|
||||||
|
>
|
||||||
|
Reject
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
@@ -286,9 +308,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
<Text>{e.title}</Text>
|
<Text>{e.title}</Text>
|
||||||
<Link
|
<Link
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href={
|
href={RouterInvestasi.api_file_dokumen + `${e.id}`}
|
||||||
RouterInvestasi.api_file_dokumen + `${e.id}`
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Button compact radius={50}>
|
<Button compact radius={50}>
|
||||||
Buka
|
Buka
|
||||||
@@ -319,7 +339,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
onChange={(val) => setCatatan(val.target.value)}
|
onChange={(val) => setCatatan(val.target.value)}
|
||||||
/>
|
/>
|
||||||
<Group position="right">
|
<Group position="right">
|
||||||
<Button radius={50} compact onClick={() => onCatatan()}>
|
<Button radius={50} compact onClick={() => onReject()}>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
79
src/app_modules/admin/investasi/main/table_publish.tsx
Normal file
79
src/app_modules/admin/investasi/main/table_publish.tsx
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ActionIcon,
|
||||||
|
Box,
|
||||||
|
ScrollArea,
|
||||||
|
Table,
|
||||||
|
Tooltip,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { IconEyeCheck } from "@tabler/icons-react";
|
||||||
|
import { IconEdit, IconEye } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function TablePublish({
|
||||||
|
dataInvestsi,
|
||||||
|
}: {
|
||||||
|
dataInvestsi: MODEL_Investasi[];
|
||||||
|
}) {
|
||||||
|
const [investasi, setInvestasi] = useState(dataInvestsi);
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const tableBody = investasi.map((e) =>
|
||||||
|
e.MasterStatusInvestasi.id === "3" ? (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>{e.title}</td>
|
||||||
|
<td>
|
||||||
|
{e.MasterStatusInvestasi.id === "3" ? (
|
||||||
|
<Badge variant="dot" color="green">
|
||||||
|
{e.MasterStatusInvestasi.name}
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
|
"-"
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Tooltip label="Detail" withArrow position="bottom">
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<IconEyeCheck />
|
||||||
|
</ActionIcon>
|
||||||
|
</Tooltip>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box my={"lg"}>
|
||||||
|
<ScrollArea w={"100%"}>
|
||||||
|
{/* <Title order={5} mb={5}>
|
||||||
|
List Publish
|
||||||
|
</Title> */}
|
||||||
|
<Badge color="green" variant="light" radius={0} size={"xl"}>
|
||||||
|
Publish
|
||||||
|
</Badge>
|
||||||
|
<Table withBorder highlightOnHover>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nama Proyek Investasi</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
77
src/app_modules/admin/investasi/main/table_reject.tsx
Normal file
77
src/app_modules/admin/investasi/main/table_reject.tsx
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ActionIcon,
|
||||||
|
Box,
|
||||||
|
ScrollArea,
|
||||||
|
Table,
|
||||||
|
Tooltip,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { IconEdit } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function TableReject({
|
||||||
|
dataInvestsi,
|
||||||
|
}: {
|
||||||
|
dataInvestsi: MODEL_Investasi[];
|
||||||
|
}) {
|
||||||
|
const [investasi, setInvestasi] = useState(dataInvestsi);
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const tableBody = investasi.map((e) =>
|
||||||
|
e.MasterStatusInvestasi.id === "4" ? (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>{e.title}</td>
|
||||||
|
<td>
|
||||||
|
{e.MasterStatusInvestasi.id === "4" ? (
|
||||||
|
<Badge variant="dot" color="red">
|
||||||
|
{e.MasterStatusInvestasi.name}
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
|
"-"
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td>{e.catatan}</td>
|
||||||
|
<td>
|
||||||
|
<Tooltip label="Konfirmasi" withArrow position="bottom">
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<IconEdit />
|
||||||
|
</ActionIcon>
|
||||||
|
</Tooltip>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box my={"lg"}>
|
||||||
|
<ScrollArea w={"100%"}>
|
||||||
|
<Badge color="red" variant="light" radius={0} size={"xl"}>
|
||||||
|
Reject
|
||||||
|
</Badge>
|
||||||
|
<Table withBorder highlightOnHover>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nama Proyek Investasi</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Catatan</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
74
src/app_modules/admin/investasi/main/table_review.tsx
Normal file
74
src/app_modules/admin/investasi/main/table_review.tsx
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ActionIcon,
|
||||||
|
Box,
|
||||||
|
ScrollArea,
|
||||||
|
Table,
|
||||||
|
Tooltip,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { IconEdit } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function TableReview({
|
||||||
|
dataInvestsi,
|
||||||
|
}: {
|
||||||
|
dataInvestsi: MODEL_Investasi[];
|
||||||
|
}) {
|
||||||
|
const [investasi, setInvestasi] = useState(dataInvestsi);
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const tableBody = investasi.map((e) =>
|
||||||
|
e.MasterStatusInvestasi.id === "2" ? (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td>{e.title}</td>
|
||||||
|
<td>
|
||||||
|
{e.MasterStatusInvestasi.id === "2" ? (
|
||||||
|
<Badge variant="dot" color="orange">
|
||||||
|
{e.MasterStatusInvestasi.name}
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
|
"-"
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Tooltip label="Konfirmasi" withArrow position="bottom">
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<IconEdit />
|
||||||
|
</ActionIcon>
|
||||||
|
</Tooltip>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box my={"lg"}>
|
||||||
|
<ScrollArea w={"100%"}>
|
||||||
|
<Badge color="orange" variant="light" radius={0} size={"xl"}>
|
||||||
|
Review
|
||||||
|
</Badge>
|
||||||
|
<Table withBorder highlightOnHover>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nama Proyek Investasi</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableBody}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -19,6 +19,9 @@ import {
|
|||||||
import { IconEdit } from "@tabler/icons-react";
|
import { IconEdit } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import TablePublish from "./table_publish";
|
||||||
|
import TableReview from "./table_review";
|
||||||
|
import TableReject from "./table_reject";
|
||||||
|
|
||||||
export default function Admin_Investasi({
|
export default function Admin_Investasi({
|
||||||
listInvestasi,
|
listInvestasi,
|
||||||
@@ -59,33 +62,6 @@ export default function Admin_Investasi({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const tableBody = investasi.map((e) => (
|
|
||||||
<tr key={e.id}>
|
|
||||||
<td>{e.title}</td>
|
|
||||||
<td>
|
|
||||||
{e.MasterStatusInvestasi.id === "3" ? (
|
|
||||||
<Badge variant="dot" color="green">
|
|
||||||
{e.MasterStatusInvestasi.name}
|
|
||||||
</Badge>
|
|
||||||
) : (
|
|
||||||
<Badge variant="dot" color="red">
|
|
||||||
{e.MasterStatusInvestasi.name}
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() =>
|
|
||||||
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<IconEdit />
|
|
||||||
</ActionIcon>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Title>Investasi</Title>
|
<Title>Investasi</Title>
|
||||||
@@ -108,67 +84,16 @@ export default function Admin_Investasi({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<TablePublish dataInvestsi={investasi as any} />
|
||||||
<Box my={"lg"}>
|
<TableReview dataInvestsi={investasi as any} />
|
||||||
<Center my={"xs"}>
|
<TableReject dataInvestsi={investasi as any} />
|
||||||
<Text>List Investasi</Text>
|
{/* <pre>{JSON.stringify(investasi, null, 2)}</pre> */}
|
||||||
</Center>
|
|
||||||
<ScrollArea w={"100%"}>
|
|
||||||
<Table withBorder highlightOnHover>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Nama Proyek Investasi</th>
|
|
||||||
<th>Status</th>
|
|
||||||
<th>Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>{tableBody}</tbody>
|
|
||||||
</Table>
|
|
||||||
</ScrollArea>
|
|
||||||
</Box>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const listTable = [
|
|
||||||
// {
|
|
||||||
// id: 1,
|
|
||||||
// status: {
|
|
||||||
// id: 1,
|
|
||||||
// name: "Publish",
|
|
||||||
// },
|
|
||||||
// name: "Subway Kuta",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 2,
|
|
||||||
// status: {
|
|
||||||
// id: 2,
|
|
||||||
// name: "Review",
|
|
||||||
// },
|
|
||||||
// name: "Event MCD",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 3,
|
|
||||||
// status: {
|
|
||||||
// id: 2,
|
|
||||||
// name: " Review",
|
|
||||||
// },
|
|
||||||
// name: "Villa Batubulan",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 4,
|
|
||||||
// status: {
|
|
||||||
// id: 1,
|
|
||||||
// name: "Publish",
|
|
||||||
// },
|
|
||||||
// name: "Kost Alif Denpasar",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 5,
|
|
||||||
// status: {
|
|
||||||
// id: 1,
|
|
||||||
// name: "Publish",
|
|
||||||
// },
|
|
||||||
// name: "Pabrik Rokok Surya Gandum",
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ export default async function funEditInvestasi(
|
|||||||
formData: FormData,
|
formData: FormData,
|
||||||
data: MODEL_Investasi
|
data: MODEL_Investasi
|
||||||
) {
|
) {
|
||||||
const file = formData.get("file");
|
const file = formData?.get("file");
|
||||||
|
|
||||||
if (file !== "null") {
|
if (file !== "null") {
|
||||||
const file: any = formData.get("file");
|
const file: any = formData?.get("file");
|
||||||
const fName = file.name;
|
const fName = file.name;
|
||||||
const fExt =
|
const fExt =
|
||||||
file && file.name ? _.lowerCase(file.name.split(".").pop()) : "";
|
file && file.name ? _.lowerCase(file.name.split(".").pop()) : "";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export default async function funGantiStatusInvestasi(id: string, val: string) {
|
export default async function funGantiStatusInvestasi(id: string, val: string) {
|
||||||
@@ -16,6 +17,7 @@ export default async function funGantiStatusInvestasi(id: string, val: string) {
|
|||||||
if(!data) return {status: 400}
|
if(!data) return {status: 400}
|
||||||
|
|
||||||
revalidatePath("/dev/investasi/main/portofolio")
|
revalidatePath("/dev/investasi/main/portofolio")
|
||||||
|
revalidatePath(RouterAdminInvestasi.main_investasi)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export interface MODEL_Investasi {
|
|||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
authorId: string;
|
authorId: string;
|
||||||
imagesId: string;
|
imagesId: string;
|
||||||
|
catatan: string
|
||||||
MasterStatusInvestasi: MODEL_Status_investasi;
|
MasterStatusInvestasi: MODEL_Status_investasi;
|
||||||
BeritaInvestasi: Model_Berita_Investasi[];
|
BeritaInvestasi: Model_Berita_Investasi[];
|
||||||
DokumenInvestasi: Model_Dokumen_Investasi[];
|
DokumenInvestasi: Model_Dokumen_Investasi[];
|
||||||
|
|||||||
Reference in New Issue
Block a user