fix
Desc: - Perubahan minor
This commit is contained in:
@@ -17,7 +17,6 @@ export async function POST(req: Request) {
|
||||
masterBidangBisnisId: body.masterBidangBisnisId,
|
||||
},
|
||||
});
|
||||
console.log(data)
|
||||
|
||||
return NextResponse.json({ status: 201, success: true });
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user