Mobile Api: Admin investasi

Add:
- src/app/api/mobile/admin/investment/

Fix:
-   src/app/api/mobile/investment/route.ts

### No Issue
This commit is contained in:
2025-10-30 17:41:59 +08:00
parent 2e2a5c2566
commit b209a12315
5 changed files with 357 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib";
export { GET };
async function GET(req: Request, { params }: { params: { id: string } }) {
const { id } = params;
try {
const data = await prisma.investasi_Invoice.findUnique({
where: {
id: id,
},
select: {
id: true,
investasiId: true,
nominal: true,
createdAt: true,
Author: true,
StatusInvoice: true,
imageId: true,
MasterBank: true,
},
});
return NextResponse.json(
{
success: true,
message: "Berhasil mendapatkan data",
data: data,
},
{ status: 200 }
);
} catch (error) {
console.log("[ERROR]", error);
return NextResponse.json(
{
success: false,
message: "Error get detail Investasi",
reason: (error as Error).message,
},
{ status: 500 }
);
}
}