Fix upload

Deksripsi:
- Fix upload foto
- Fix email regex
This commit is contained in:
2024-12-11 10:32:00 +08:00
parent b2e48ba06c
commit 6e1a2e4bd3
13 changed files with 376 additions and 219 deletions

View File

@@ -20,7 +20,7 @@ export async function POST(req: Request) {
},
});
if (dataUser === null)
if (dataUser == null)
return NextResponse.json(
{ success: false, message: "Nomor Belum Terdaftar" },
{ status: 404 }
@@ -32,37 +32,6 @@ export async function POST(req: Request) {
user: dataUser as any,
});
// const cekSessionUser = await prisma.userSession.findFirst({
// where: {
// userId: dataUser.id,
// },
// });
// if (cekSessionUser !== null) {
// await prisma.userSession.delete({
// where: {
// userId: dataUser.id,
// },
// });
// }
// try {
// const createUserSession = await prisma.userSession.create({
// data: {
// token: token as string,
// userId: dataUser.id,
// },
// });
// if (!createUserSession)
// return NextResponse.json(
// { success: false, message: "Gagal Membuat Session" },
// { status: 400 }
// );
// } catch (error) {
// console.log(error);
// }
return NextResponse.json(
{
success: true,