Merge pull request 'join' (#19) from join into staging
Reviewed-on: bip/sistem-desa-mandiri#19
This commit is contained in:
@@ -109,7 +109,10 @@ export async function PUT(request: Request, context: { params: { id: string } })
|
|||||||
|
|
||||||
const cek = await prisma.position.count({
|
const cek = await prisma.position.count({
|
||||||
where: {
|
where: {
|
||||||
name: name,
|
name: {
|
||||||
|
equals: name,
|
||||||
|
mode: "insensitive"
|
||||||
|
},
|
||||||
idGroup: idGroup,
|
idGroup: idGroup,
|
||||||
NOT: {
|
NOT: {
|
||||||
id: id
|
id: id
|
||||||
@@ -133,7 +136,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
|
|||||||
} else {
|
} else {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ success: false, message: "Jabatan sudah ada" },
|
{ success: false, message: "Jabatan sudah ada" },
|
||||||
{ status: 400 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export async function GET(request: Request) {
|
|||||||
id: true,
|
id: true,
|
||||||
name: true,
|
name: true,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
idGroup: true,
|
||||||
Group: {
|
Group: {
|
||||||
select: {
|
select: {
|
||||||
name: true
|
name: true
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
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) {
|
} catch (error) {
|
||||||
console.error(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 });
|
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