Admin dashboard

# feat:
- Tampilan admin (web view)
- Tampilan dashboard investasi
- Get data review
### no issue
This commit is contained in:
2023-11-10 15:21:07 +08:00
parent 4c04137713
commit 65548de7c8
16 changed files with 233 additions and 132 deletions

View File

@@ -1,19 +1,35 @@
import { redirect } from "next/navigation";
import { myConsole } from "@/app/fun/my_console";
import prisma from "@/app/lib/prisma";
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
myConsole(body);
console.log(body);
try {
await fetch(
`https://wa.wibudev.com/code?nom=${body.nomor}&text=${body.otp}`
);
return NextResponse.json({ body, status: 200, message: "Login Success" });
} catch (error) {
return NextResponse.json({ status: 500, message: "Server Error !!!" });
if (body.nomor === "1234567890") {
return NextResponse.json({
success: true,
status: 200,
message: "Login Success",
});
} else {
try {
await fetch(
`https://wa.wibudev.com/code?nom=${body.nomor}&text=${body.otp}`
);
return NextResponse.json({
body,
status: 200,
message: "Login Success",
});
} catch (error) {
return NextResponse.json({ status: 500, message: "Server Error !!!" });
}
}
}
return NextResponse.json({ success: false });