Test foto server
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/_lib/interface";
|
||||
|
||||
export default async function adminAppInformation_updateStatusBankById({
|
||||
data,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/_lib/interface";
|
||||
|
||||
export default async function adminAppInformation_updateDataBankById({
|
||||
data,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_DATA_BANK } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
ActionIcon,
|
||||
Button,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Paper, Stack, Title, AspectRatio, Center, Image } from "@mantine/core";
|
||||
|
||||
export function ComponentAdminInvestasi_DetailGambar({imagesId}: {imagesId: any}) {
|
||||
@@ -17,7 +17,7 @@ export function ComponentAdminInvestasi_DetailGambar({imagesId}: {imagesId: any}
|
||||
radius={"md"}
|
||||
width={200}
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${imagesId}`}
|
||||
src={RouterInvestasi_OLD.api_gambar + `${imagesId}`}
|
||||
/>
|
||||
</Center>
|
||||
</AspectRatio>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import {
|
||||
SimpleGrid,
|
||||
Paper,
|
||||
@@ -50,7 +50,7 @@ export function ComponentAdminInvestasi_UIDetailFile({
|
||||
<Link
|
||||
target="_blank"
|
||||
href={
|
||||
RouterInvestasi.api_file_prospektus +
|
||||
RouterInvestasi_OLD.api_file_prospektus +
|
||||
`${dataProspektus === null ? "" : dataProspektus.id}`
|
||||
}
|
||||
>
|
||||
@@ -78,7 +78,7 @@ export function ComponentAdminInvestasi_UIDetailFile({
|
||||
<Link
|
||||
target="_blank"
|
||||
href={
|
||||
RouterInvestasi.api_file_dokumen + `${e.id}`
|
||||
RouterInvestasi_OLD.api_file_dokumen + `${e.id}`
|
||||
}
|
||||
>
|
||||
<Button radius={50}>Lihat</Button>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
@@ -16,14 +16,14 @@ import {
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { IconCircleCheck, IconHome } from "@tabler/icons-react";
|
||||
import investasi from "../../notifikasi/route_setting/investasi";
|
||||
|
||||
export function AdminInvestasi_DetailPublish({
|
||||
data,
|
||||
}: {
|
||||
data: MODEL_Investasi;
|
||||
data: MODEL_INVESTASI;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -38,7 +38,7 @@ export function AdminInvestasi_DetailPublish({
|
||||
);
|
||||
}
|
||||
|
||||
function InformasiAuthor({ data }: { data: MODEL_Investasi }) {
|
||||
function InformasiAuthor({ data }: { data: MODEL_INVESTASI }) {
|
||||
return (
|
||||
<>
|
||||
<Paper withBorder>
|
||||
@@ -55,7 +55,7 @@ function InformasiAuthor({ data }: { data: MODEL_Investasi }) {
|
||||
radius={"md"}
|
||||
width={250}
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||
src={RouterInvestasi_OLD.api_gambar + `${data.imagesId}`}
|
||||
/>
|
||||
</Center>
|
||||
</AspectRatio>
|
||||
@@ -84,7 +84,7 @@ function InformasiAuthor({ data }: { data: MODEL_Investasi }) {
|
||||
);
|
||||
}
|
||||
|
||||
function InformasiDataInvestasi({ data }: { data: MODEL_Investasi }) {
|
||||
function InformasiDataInvestasi({ data }: { data: MODEL_INVESTASI }) {
|
||||
return (
|
||||
<>
|
||||
<Paper withBorder p={"lg"}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
Paper,
|
||||
SimpleGrid,
|
||||
@@ -14,11 +14,7 @@ import { ComponentAdminInvestasi_DetailData } from "../_component/detail_data_in
|
||||
import { ComponentAdminInvestasi_DetailGambar } from "../_component/detail_gambar_investasi";
|
||||
import { ComponentAdminInvestasi_UIDetailFile } from "../_component/ui_detail_file";
|
||||
|
||||
export function AdminInvestasi_DetailReject({
|
||||
data,
|
||||
}: {
|
||||
data: MODEL_Investasi;
|
||||
}) {
|
||||
export function AdminInvestasi_DetailReject({ data }: { data: MODEL_INVESTASI }) {
|
||||
return (
|
||||
<>
|
||||
<Stack px={"lg"}>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { BeritaInvestasi } from "@/app_modules/investasi";
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import {
|
||||
AspectRatio,
|
||||
@@ -49,7 +49,7 @@ import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_b
|
||||
export default function AdminInvestasi_DetailReview({
|
||||
dataInvestasi,
|
||||
}: {
|
||||
dataInvestasi: MODEL_Investasi;
|
||||
dataInvestasi: MODEL_INVESTASI;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState(dataInvestasi);
|
||||
@@ -263,7 +263,7 @@ export default function AdminInvestasi_DetailReview({
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||
src={RouterInvestasi_OLD.api_gambar + `${data.imagesId}`}
|
||||
/>
|
||||
</AspectRatio>
|
||||
</Paper>
|
||||
@@ -370,7 +370,7 @@ export default function AdminInvestasi_DetailReview({
|
||||
<Link
|
||||
target="_blank"
|
||||
href={
|
||||
RouterInvestasi.api_file_prospektus +
|
||||
RouterInvestasi_OLD.api_file_prospektus +
|
||||
`${
|
||||
data.ProspektusInvestasi === null
|
||||
? ""
|
||||
@@ -400,7 +400,9 @@ export default function AdminInvestasi_DetailReview({
|
||||
<Text>{e.title}</Text>
|
||||
<Link
|
||||
target="_blank"
|
||||
href={RouterInvestasi.api_file_dokumen + `${e.id}`}
|
||||
href={
|
||||
RouterInvestasi_OLD.api_file_dokumen + `${e.id}`
|
||||
}
|
||||
>
|
||||
<Button compact radius={50}>
|
||||
Buka
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function adminInvestasi_funEditStatusPublishById({
|
||||
@@ -36,7 +36,7 @@ export async function adminInvestasi_funEditStatusPublishById({
|
||||
});
|
||||
|
||||
if (!res) return { status: 400, message: "Gagal Update" };
|
||||
revalidatePath(RouterInvestasi.portofolio);
|
||||
revalidatePath(RouterInvestasi_OLD.portofolio);
|
||||
|
||||
return {
|
||||
data: res,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
Button,
|
||||
Center,
|
||||
@@ -26,7 +26,7 @@ import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_invest
|
||||
export default function Admin_TablePublishInvestasi({
|
||||
dataInvestsi,
|
||||
}: {
|
||||
dataInvestsi: MODEL_Investasi[];
|
||||
dataInvestsi: MODEL_INVESTASI[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -41,7 +41,7 @@ export default function Admin_TablePublishInvestasi({
|
||||
|
||||
function TableView({ listData }: { listData: any }) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState<MODEL_Investasi[]>(listData.data);
|
||||
const [data, setData] = useState<MODEL_INVESTASI[]>(listData.data);
|
||||
const [nPage, setNPage] = useState(listData.nPage);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
const [isSearch, setSearch] = useState("");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
Badge,
|
||||
ActionIcon,
|
||||
@@ -32,7 +32,7 @@ import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_invest
|
||||
export default function Admin_TableRejectInvestasi({
|
||||
dataInvestsi,
|
||||
}: {
|
||||
dataInvestsi: MODEL_Investasi[];
|
||||
dataInvestsi: any[];
|
||||
}) {
|
||||
const [investasi, setInvestasi] = useState(dataInvestsi);
|
||||
const router = useRouter();
|
||||
@@ -118,7 +118,7 @@ export default function Admin_TableRejectInvestasi({
|
||||
|
||||
function TableView({ listData }: { listData: any }) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState<MODEL_Investasi[]>(listData.data);
|
||||
const [data, setData] = useState<MODEL_INVESTASI[]>(listData.data);
|
||||
const [nPage, setNPage] = useState(listData.nPage);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
const [isSearch, setSearch] = useState("");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
Badge,
|
||||
ActionIcon,
|
||||
@@ -32,7 +32,7 @@ import ComponentAdminGlobal_TampilanRupiahDonasi from "../../_admin_global/tampi
|
||||
export default function Admin_TableReviewInvestasi({
|
||||
dataInvestsi,
|
||||
}: {
|
||||
dataInvestsi: MODEL_Investasi[];
|
||||
dataInvestsi: any[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -46,7 +46,7 @@ export default function Admin_TableReviewInvestasi({
|
||||
|
||||
function TableView({ listData }: { listData: any }) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState<MODEL_Investasi[]>(listData.data);
|
||||
const [data, setData] = useState<MODEL_INVESTASI[]>(listData.data);
|
||||
const [nPage, setNPage] = useState(listData.nPage);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
const [isSearch, setSearch] = useState("");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||
import {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
@@ -49,7 +49,7 @@ export default function Admin_Investasi({
|
||||
totalInvestasiByUser,
|
||||
publishProgres,
|
||||
}: {
|
||||
listInvestasi: MODEL_Investasi[];
|
||||
listInvestasi: MODEL_INVESTASI[];
|
||||
countDraft: number | any;
|
||||
countReview: number | any;
|
||||
countPublish: number | any;
|
||||
@@ -61,7 +61,6 @@ export default function Admin_Investasi({
|
||||
const router = useRouter();
|
||||
|
||||
const listBox = [
|
||||
|
||||
{
|
||||
id: 1,
|
||||
name: "Publish",
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Drawer, Group, Text } from "@mantine/core";
|
||||
import { ComponentAdmin_UIDrawerNotifikasi } from "../../notifikasi/ui_drawer_notifikasi";
|
||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||
|
||||
export function ComponentAdminMap_Drawer({
|
||||
opened,
|
||||
onClose,
|
||||
data,
|
||||
}: {
|
||||
opened: boolean;
|
||||
onClose: () => void;
|
||||
data: MODEL_MAP | any;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
title={
|
||||
<Group position="apart">
|
||||
<Text fw={"bold"} fz={"lg"}>
|
||||
Detail Map
|
||||
</Text>
|
||||
</Group>
|
||||
}
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
position="right"
|
||||
size={"xs"}
|
||||
transitionProps={{transition: "fade", duration: 500}}
|
||||
>
|
||||
<Text>Detail Map</Text>
|
||||
<Text>{data}</Text>
|
||||
</Drawer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
120
src/app_modules/admin/map/component/drawer_detail_map.tsx
Normal file
120
src/app_modules/admin/map/component/drawer_detail_map.tsx
Normal file
@@ -0,0 +1,120 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
Drawer,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { ComponentAdmin_UIDrawerNotifikasi } from "../../notifikasi/ui_drawer_notifikasi";
|
||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
|
||||
import { useState } from "react";
|
||||
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
|
||||
import {
|
||||
IconBuildingSkyscraper,
|
||||
IconListDetails,
|
||||
IconPhoneCall,
|
||||
IconMapPin,
|
||||
IconPinned,
|
||||
} from "@tabler/icons-react";
|
||||
|
||||
export function ComponentAdminMap_Drawer({
|
||||
opened,
|
||||
onClose,
|
||||
mapId,
|
||||
}: {
|
||||
opened: boolean;
|
||||
onClose: () => void;
|
||||
mapId: string;
|
||||
}) {
|
||||
const [data, setData] = useState<MODEL_MAP>();
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoadMap(mapId);
|
||||
}, [mapId]);
|
||||
|
||||
async function onLoadMap(mapId: string) {
|
||||
const res = await adminMap_funGetOneById({ mapId: mapId });
|
||||
setData(res as any);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
title={
|
||||
<Group position="apart">
|
||||
<Text fw={"bold"} fz={"lg"}>
|
||||
{data?.namePin}
|
||||
</Text>
|
||||
</Group>
|
||||
}
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
position="right"
|
||||
size={"sm"}
|
||||
>
|
||||
<Stack>
|
||||
<AspectRatio ratio={1 / 1} mah={300}>
|
||||
<Image
|
||||
radius={"md"}
|
||||
width={300}
|
||||
alt="Foto"
|
||||
src={RouterMap.api_foto + data?.imagesId}
|
||||
/>
|
||||
</AspectRatio>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<IconBuildingSkyscraper />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{data?.Portofolio.namaBisnis}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<IconListDetails />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{data?.Portofolio.MasterBidangBisnis.name}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<IconPhoneCall />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>+{data?.Portofolio.tlpn}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<IconMapPin />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{data?.Portofolio.alamatKantor}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<IconPinned />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text >{data?.Portofolio.deskripsi}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
</Stack>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</Drawer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
import { ComponentAdminMap_Drawer } from "./drawer";
|
||||
import { ComponentAdminMap_Drawer } from "./drawer_detail_map";
|
||||
|
||||
export { ComponentAdminMap_Drawer };
|
||||
|
||||
25
src/app_modules/admin/map/fun/fun_get_one_by_id.ts
Normal file
25
src/app_modules/admin/map/fun/fun_get_one_by_id.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function adminMap_funGetOneById({ mapId }: { mapId: string }) {
|
||||
const data = await prisma.businessMaps.findFirst({
|
||||
where: {
|
||||
id: mapId,
|
||||
},
|
||||
include: {
|
||||
Author: true,
|
||||
Images: true,
|
||||
Portofolio: {
|
||||
include: {
|
||||
MasterBidangBisnis: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
return data;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export function UiAdminMap_MapBoxView({
|
||||
<ComponentAdminMap_Drawer
|
||||
opened={openDrawer}
|
||||
onClose={() => setOpenDrawer(false)}
|
||||
data={mapId as any}
|
||||
mapId={mapId as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -6,6 +6,7 @@ import { UiAdminMap_MapBoxView } from "../ui";
|
||||
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
||||
export async function AdminMap_View() {
|
||||
const dataMap = await adminMap_funGetAllMaps();
|
||||
|
||||
return (
|
||||
<>
|
||||
<ComponentAdminGlobal_HeaderTamplate name="Maps" />
|
||||
|
||||
Reference in New Issue
Block a user