Mobile API Admin: Main dashboard, User Access, Super admin

Add:
- api/mobile/admin/

### No Issue
This commit is contained in:
nabillah
2025-10-14 17:31:53 +08:00
parent 51c70ef98a
commit 5287fb90bf
3 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import { prisma } from "@/lib";
import { NextResponse } from "next/server";
export async function GET(request: Request) {
let fixDAta;
try {
const user = await prisma.user.count({
where: {
active: true,
},
});
const portofolio = await prisma.portofolio.count({
where: {
active: true,
},
});
fixDAta = {
user: user,
portofolio: portofolio,
};
return NextResponse.json({
status: 200,
success: true,
message: "Success get data main dashboard",
data: fixDAta,
});
} catch (error) {
return NextResponse.json({
status: 500,
success: false,
message: "Error get data main dashboard",
reason: (error as Error).message,
});
}
}