upd: api mobile status saat error

This commit is contained in:
2025-10-16 14:53:23 +08:00
parent 1b8bfebf4f
commit ed2c9495c3
14 changed files with 34 additions and 33 deletions

View File

@@ -19,7 +19,7 @@ export async function GET(request: Request, context: { params: { id: string } })
const user = await funGetUserById({ id: String(userMobile) })
if (user.id == "null" || user.id == undefined || user.id == "") {
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 200 });
}
const cek = await prisma.discussion.count({
@@ -29,7 +29,7 @@ export async function GET(request: Request, context: { params: { id: string } })
})
if (cek == 0) {
return NextResponse.json({ success: false, message: "Gagal mendapatkan diskusi, data tidak ditemukan" }, { status: 404 });
return NextResponse.json({ success: false, message: "Gagal mendapatkan diskusi, data tidak ditemukan" }, { status: 200 });
}
if (kategori == "detail") {