feat
Desc: - Fitur Detail investasi - Fitur Proses investasi - Fitur upload bukti trnsfer # No issue
This commit is contained in:
@@ -6,34 +6,27 @@ export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
) {
|
||||
|
||||
const data = await prisma.images.findUnique({
|
||||
where: {
|
||||
id: params.id,
|
||||
},
|
||||
select: {
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(params.id)
|
||||
const data = await prisma.images.findUnique({
|
||||
where: {
|
||||
id: params.id,
|
||||
},
|
||||
select: {
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(data)
|
||||
|
||||
// return data
|
||||
|
||||
if (!fs.existsSync(`./public/investasi/${data?.url}`)) {
|
||||
const fl = fs.readFileSync(`./public/aset/no-img.png`);
|
||||
return new NextResponse(fl, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
const fl = fs.readFileSync(`./public/investasi/${data?.url}`);
|
||||
if (!fs.existsSync(`./public/investasi/${data?.url}`)) {
|
||||
const fl = fs.readFileSync(`./public/aset/no-img.png`);
|
||||
return new NextResponse(fl, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
const fl = fs.readFileSync(`./public/investasi/${data?.url}`);
|
||||
return new NextResponse(fl, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
8
src/app/dev/investasi/detail/[id]/layout.tsx
Normal file
8
src/app/dev/investasi/detail/[id]/layout.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { LayoutDetailInvestasi } from "@/app_modules/investasi";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
||||
return<>
|
||||
<LayoutDetailInvestasi>{children}</LayoutDetailInvestasi>
|
||||
</>
|
||||
}
|
||||
7
src/app/dev/investasi/detail/[id]/page.tsx
Normal file
7
src/app/dev/investasi/detail/[id]/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { DetailInvestasi } from "@/app_modules/investasi";
|
||||
|
||||
export default async function Page() {
|
||||
return<>
|
||||
<DetailInvestasi/>
|
||||
</>
|
||||
}
|
||||
8
src/app/dev/investasi/proses_investasi/layout.tsx
Normal file
8
src/app/dev/investasi/proses_investasi/layout.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { LayoutProsesInvestasi } from "@/app_modules/investasi";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
||||
return<>
|
||||
<LayoutProsesInvestasi>{children}</LayoutProsesInvestasi>
|
||||
</>
|
||||
}
|
||||
7
src/app/dev/investasi/proses_investasi/page.tsx
Normal file
7
src/app/dev/investasi/proses_investasi/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ProsesInvestasi } from "@/app_modules/investasi";
|
||||
|
||||
export default async function Page() {
|
||||
return<>
|
||||
<ProsesInvestasi/>
|
||||
</>
|
||||
}
|
||||
8
src/app/dev/investasi/upload_bukti/layout.tsx
Normal file
8
src/app/dev/investasi/upload_bukti/layout.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { LayoutBuktiTransferInvestasi } from "@/app_modules/investasi";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
||||
return<>
|
||||
<LayoutBuktiTransferInvestasi>{children}</LayoutBuktiTransferInvestasi>
|
||||
</>
|
||||
}
|
||||
5
src/app/dev/investasi/upload_bukti/page.tsx
Normal file
5
src/app/dev/investasi/upload_bukti/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { UploadBuktiTransferInvestasi } from "@/app_modules/investasi";
|
||||
|
||||
export default async function Page() {
|
||||
return <UploadBuktiTransferInvestasi/>
|
||||
}
|
||||
Reference in New Issue
Block a user