upd: kode error pada api

This commit is contained in:
amel
2024-10-23 17:54:13 +08:00
parent 31e1d4fcc9
commit e59335176f
41 changed files with 193 additions and 233 deletions

View File

@@ -1,12 +1,9 @@
// SEARCH USER, DIVISION, PROJECT
import { prisma } from "@/module/_global";
import { funGetUserByCookies } from "@/module/auth";
import _ from "lodash";
import { NextResponse } from "next/server";
// SEARCH USER, DIVISION, PROJECT
export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url)
@@ -136,6 +133,6 @@ export async function GET(request: Request) {
return NextResponse.json({ success: true, data: allDataSearch }, { status: 200 });
} catch (error) {
return NextResponse.json({ success: false, message: error }, { status: 500 });
return NextResponse.json({ success: false, message: 'Gagal mendapatkan data, coba lagi nanti (error: 500)' }, { status: 500 });
}
}