upd: kode error pada api
This commit is contained in:
@@ -65,6 +65,6 @@ export async function GET(request: Request, context: { params: { id: string } })
|
||||
return NextResponse.json({ success: true, data: fixMember })
|
||||
|
||||
} catch (error) {
|
||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan member, data tidak ditemukan", }, { status: 404 });
|
||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan anggota, data tidak ditemukan (error: 500)", }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
// GET LIST DIVISI BY ID DIVISI (CONTOH : UNTUK SHARE DOKUMEN)
|
||||
@@ -48,6 +47,6 @@ export async function GET(request: Request) {
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan divisi, coba lagi nanti", reason: (error as Error).message, }, { status: 500 });
|
||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan divisi, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import _, { ceil } from "lodash";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
|
||||
const user = await funGetUserByCookies()
|
||||
const { searchParams } = new URL(request.url)
|
||||
const group = searchParams.get("group")
|
||||
@@ -193,6 +192,6 @@ export async function GET(request: Request) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti", reason: (error as Error).message, }, { status: 500 });
|
||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user