Admin dashboard
# feat: - Tampilan admin (web view) - Tampilan dashboard investasi - Get data review ### no issue
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { Admin_Investasi } from "@/app_modules/admin/investasi";
|
||||
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
||||
|
||||
export default async function Page() {
|
||||
return<>
|
||||
<Admin_Investasi/>
|
||||
const listInvestasi = await Admin_funGetAllInvestasi();
|
||||
// console.log(listInvestasi)
|
||||
return (
|
||||
<>
|
||||
<Admin_Investasi listInvestasi={listInvestasi as any} />
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
7
src/app/dev/admin/splash/page.tsx
Normal file
7
src/app/dev/admin/splash/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { SplashDashboardAdmin } from "@/app_modules/admin/main";
|
||||
|
||||
export default async function Page() {
|
||||
return<>
|
||||
<SplashDashboardAdmin/>
|
||||
</>
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import { LayoutEditIntroInvestasi } from "@/app_modules/investasi";
|
||||
import { test_server } from "@/app_modules/investasi/edit_intro/_makuro/test_server";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
import { EditIntroInvestasi } from "@/app_modules/investasi";
|
||||
import { test_server } from "@/app_modules/investasi/edit_intro/_makuro/test_server";
|
||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
||||
import getPencarianInvestor from "@/app_modules/investasi/fun/master/get_pencarian_investor";
|
||||
import getPeriodeDeviden from "@/app_modules/investasi/fun/master/get_periode_deviden";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataInvestasi = await getOneInvestasiById(params.id)
|
||||
const listPencarian = await getPencarianInvestor()
|
||||
const listPeriode = await getPeriodeDeviden()
|
||||
const listPembagian = await getPembagianDeviden()
|
||||
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
const listPencarian = await getPencarianInvestor();
|
||||
const listPeriode = await getPeriodeDeviden();
|
||||
const listPembagian = await getPembagianDeviden();
|
||||
|
||||
return (
|
||||
<>
|
||||
<EditIntroInvestasi
|
||||
|
||||
dataInvestasi={dataInvestasi as any}
|
||||
listPencarian={listPencarian as any}
|
||||
listPeriode={listPeriode as any}
|
||||
listPembagian={listPembagian as any}
|
||||
<EditIntroInvestasi
|
||||
dataInvestasi={dataInvestasi as any}
|
||||
listPencarian={listPencarian as any}
|
||||
listPeriode={listPeriode as any}
|
||||
listPembagian={listPembagian as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export const RouterAdminDashboard = {
|
||||
main_admin: "/dev/admin/main/dashboard",
|
||||
splash_admin: "/dev/admin/splash",
|
||||
};
|
||||
|
||||
export const RouterAdminInvestasi = {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
'use client'
|
||||
import { test_server } from "@/app_modules/investasi/edit_intro/_makuro/test_server";
|
||||
|
||||
import { Button } from "@mantine/core";
|
||||
import makuro_test from "./makuro_test";
|
||||
|
||||
export default function ViewMakuro() {
|
||||
|
||||
return <>
|
||||
<Button
|
||||
onClick={() => test_server()}
|
||||
onClick={() => makuro_test()}
|
||||
>Tekan Aja</Button>
|
||||
</>
|
||||
}
|
||||
Reference in New Issue
Block a user