Desc:
- Perubahan minor
This commit is contained in:
2023-10-06 15:09:59 +08:00
parent 80594415e0
commit b49eb321de
9 changed files with 81 additions and 55 deletions

View File

@@ -17,7 +17,6 @@ export async function POST(req: Request) {
masterBidangBisnisId: body.masterBidangBisnisId,
},
});
console.log(data)
return NextResponse.json({ status: 201, success: true });
}

View File

@@ -5,7 +5,7 @@ import { NextResponse } from "next/server";
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
myConsole(body);
// myConsole(body);
const data = await prisma.profile.create({
data: {

View File

@@ -1,11 +1,22 @@
import { NextRequest, NextResponse } from "next/server";
import fs from 'fs'
import fs from "fs";
export async function GET(req: NextRequest, { params }: { params: { name: string } }) {
const fl = fs.readFileSync(`./public/img/${params.name}`)
export async function GET(
req: NextRequest,
{ params }: { params: { name: string } }
) {
if (!fs.existsSync(`./public/img/${params.name}`)) {
const fl = fs.readFileSync(`./public/aset/avatar.png`);
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png"
}
})
}
headers: {
"Content-Type": "image/png",
},
});
}
const fl = fs.readFileSync(`./public/img/${params.name}`);
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png",
},
});
}