diff --git a/src/app/api/mobile/position/[id]/route.ts b/src/app/api/mobile/position/[id]/route.ts index d13fa5d..7655611 100644 --- a/src/app/api/mobile/position/[id]/route.ts +++ b/src/app/api/mobile/position/[id]/route.ts @@ -109,7 +109,10 @@ export async function PUT(request: Request, context: { params: { id: string } }) const cek = await prisma.position.count({ where: { - name: name, + name: { + equals: name, + mode: "insensitive" + }, idGroup: idGroup, NOT: { id: id @@ -133,7 +136,7 @@ export async function PUT(request: Request, context: { params: { id: string } }) } else { return NextResponse.json( { success: false, message: "Jabatan sudah ada" }, - { status: 400 } + { status: 200 } ); } diff --git a/src/app/api/mobile/position/route.ts b/src/app/api/mobile/position/route.ts index 9b0e591..eeec356 100644 --- a/src/app/api/mobile/position/route.ts +++ b/src/app/api/mobile/position/route.ts @@ -61,6 +61,7 @@ export async function GET(request: Request) { id: true, name: true, isActive: true, + idGroup: true, Group: { select: { name: true diff --git a/src/app/api/version-app/route.ts b/src/app/api/version-app/route.ts index f14e0ef..6ee9d87 100644 --- a/src/app/api/version-app/route.ts +++ b/src/app/api/version-app/route.ts @@ -2,7 +2,7 @@ import { NextResponse } from "next/server"; export async function GET(request: Request) { try { - return NextResponse.json({ success: true, version: "1.7.0", 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.7.1", 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 }); } 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 });