Desc:
- Fitur Detail investasi
- Fitur Proses investasi
- Fitur upload bukti trnsfer
# No issue
This commit is contained in:
2023-10-20 17:52:36 +08:00
parent bff07e84b1
commit cdd09e6fbf
24 changed files with 532 additions and 61 deletions

View File

@@ -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",
},
});
}