Update Versi 1.5.27 #32

Merged
bagasbanuna merged 1009 commits from staging into main 2025-12-17 12:22:28 +08:00
2136 changed files with 90971 additions and 24367 deletions
Showing only changes of commit fbb5691359 - Show all commits

View File

@@ -0,0 +1,53 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib";
export { POST };
async function POST(request: Request) {
try {
const { data } = await request.json();
const existingEmail = await prisma.profile.findUnique({
where: {
email: data.email,
},
});
if (existingEmail) {
return NextResponse.json({
success: false,
message: "Email telah digunakan",
status: 400,
});
}
console.log("data", data);
const create = await prisma.profile.create({
data: {
userId: data.id,
name: data.name,
email: data.email,
alamat: data.alamat,
jenisKelamin: data.jenisKelamin,
},
});
return NextResponse.json(
{
success: true,
message: "Create profile success",
},
{ status: 201 }
);
} catch (error) {
console.log("error", error);
return NextResponse.json(
{
success: false,
message: "Create profile failed",
},
{ status: 500 }
);
}
}