mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-08-02 08:22:31 +00:00
add admin checks for admin pages and run biome formating 🔨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { Suspense } from "react";
|
||||
import { authOptions } from "@/app/auth";
|
||||
import { UsersPaymentsTable } from "@/components/admin/user-payments-table";
|
||||
import DynamicFilter from "@/components/generic-filter";
|
||||
|
||||
@ -13,7 +16,9 @@ export default async function UserPayments({
|
||||
}>;
|
||||
}) {
|
||||
const query = (await searchParams)?.query || "";
|
||||
// const session = await getServerSession(authOptions);
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session?.user?.is_admin) redirect("/payments?page=1");
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
|
||||
@ -70,9 +75,8 @@ export default async function UserPayments({
|
||||
{ label: "All", value: "" },
|
||||
{ label: "Wallet", value: "WALLET" },
|
||||
{ label: "Transfer", value: "TRANSFER" },
|
||||
]
|
||||
],
|
||||
},
|
||||
|
||||
]}
|
||||
/>
|
||||
<Suspense key={query} fallback={"loading...."}>
|
||||
|
Reference in New Issue
Block a user