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",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user