From 10e06197892a67c3f023774e404eaec764a78f45 Mon Sep 17 00:00:00 2001 From: amal Date: Wed, 27 Aug 2025 17:08:47 +0800 Subject: [PATCH 1/2] upd : api mobile jabatan Deskripsi: - get list data idgroup - edit jabatan > ketika sudah ada jabtan yg sama No Issues --- src/app/api/mobile/position/[id]/route.ts | 7 +++++-- src/app/api/mobile/position/route.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) 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 From 215fb59ec7110fb1820eb52bf0f93671faff0067 Mon Sep 17 00:00:00 2001 From: amal Date: Wed, 27 Aug 2025 17:10:07 +0800 Subject: [PATCH 2/2] upd: api version --- src/app/api/version-app/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 });