From 73f89711f22cb2b35f50cbdb0df0912910bb555f Mon Sep 17 00:00:00 2001 From: amel Date: Wed, 5 Mar 2025 10:55:53 +0800 Subject: [PATCH] fix: api document Deskripsi: - tidak menampilkan file sharea yg telah dihapus oleh pemilik file - No Issues --- src/app/api/document/route.ts | 8 +++++++- src/app/api/version-app/route.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/api/document/route.ts b/src/app/api/document/route.ts index adb193f..2dfb0e6 100644 --- a/src/app/api/document/route.ts +++ b/src/app/api/document/route.ts @@ -46,7 +46,10 @@ export async function GET(request: Request) { where: { isActive: true, idDivision: String(idDivision), - idDocument: String(path) + idDocument: String(path), + DivisionDocumentFolderFile: { + isActive: true + } } }) @@ -106,6 +109,9 @@ export async function GET(request: Request) { where: { isActive: true, idDivision: String(idDivision), + DivisionDocumentFolderFile: { + isActive: true + } }, select: { DivisionDocumentFolderFile: { diff --git a/src/app/api/version-app/route.ts b/src/app/api/version-app/route.ts index 0bd1756..8f29b58 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.2.5", tahap: "beta", update: "-fix api fitur divisi non aktif" }, { status: 200 }); + return NextResponse.json({ success: true, version: "1.2.5", tahap: "beta", update: "-fix api fitur divisi non aktif, -fix api tampil file/dokumen yg telah dihapus" }, { 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 });