Invesment
Add: - src/app/api/mobile/investment/[id]/invoice/ - src/app/api/mobile/master/bank/ ### No Issue
This commit is contained in:
34
src/app/api/mobile/master/bank/route.ts
Normal file
34
src/app/api/mobile/master/bank/route.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { prisma } from "@/lib";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export { GET };
|
||||
|
||||
async function GET() {
|
||||
try {
|
||||
const data = await prisma.masterBank.findMany({
|
||||
orderBy: {
|
||||
updatedAt: "asc",
|
||||
},
|
||||
where: {
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json(
|
||||
{ success: true, message: "Berhasil mendapatkan data", data: data },
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Error Get Master Bank >>", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "API Error Get Data",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user