Merge pull request 'upd: login tanpa otp' (#38) from amalia/02-sept-25 into join
Reviewed-on: bip/sistem-desa-mandiri#38
This commit is contained in:
@@ -107,6 +107,7 @@ model User {
|
||||
gender String @default("M") //M= Male, F= Female
|
||||
img String?
|
||||
isFirstLogin Boolean @default(true)
|
||||
isWithoutOTP Boolean @default(false)
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -338,20 +339,20 @@ model DivisionProjectLink {
|
||||
}
|
||||
|
||||
model DivisionProjectTask {
|
||||
id String @id @default(cuid())
|
||||
Division Division @relation(fields: [idDivision], references: [id])
|
||||
idDivision String
|
||||
DivisionProject DivisionProject @relation(fields: [idProject], references: [id])
|
||||
idProject String
|
||||
title String
|
||||
desc String? @db.Text
|
||||
status Int @default(0) // 0 = todo, 1 = done
|
||||
notifikasi Boolean @default(false)
|
||||
dateStart DateTime @db.Date
|
||||
dateEnd DateTime @db.Date
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(cuid())
|
||||
Division Division @relation(fields: [idDivision], references: [id])
|
||||
idDivision String
|
||||
DivisionProject DivisionProject @relation(fields: [idProject], references: [id])
|
||||
idProject String
|
||||
title String
|
||||
desc String? @db.Text
|
||||
status Int @default(0) // 0 = todo, 1 = done
|
||||
notifikasi Boolean @default(false)
|
||||
dateStart DateTime @db.Date
|
||||
dateEnd DateTime @db.Date
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
DivisionProjectTaskDetail DivisionProjectTaskDetail[]
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export async function POST(req: NextRequest) {
|
||||
const { phone }: ILogin = await req.json();
|
||||
const user = await prisma.user.findUnique({
|
||||
where: { phone, isActive: true },
|
||||
select: { id: true, phone: true },
|
||||
select: { id: true, phone: true, isWithoutOTP: true },
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
@@ -21,6 +21,7 @@ export async function POST(req: NextRequest) {
|
||||
success: true,
|
||||
message: "Sukses",
|
||||
phone: user.phone,
|
||||
isWithoutOTP: user.isWithoutOTP,
|
||||
id: user.id,
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
return NextResponse.json({ success: true, version: "1.7.9", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
|
||||
return NextResponse.json({ success: true, version: "1.8.0", tahap: "beta", update: "-api mobile; -login tanpa otp (mobile app); -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||
|
||||
Reference in New Issue
Block a user