mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-10 22:01:16 +00:00
Init
This commit is contained in:
19
src/app/(app)/vendors/page.tsx
vendored
Normal file
19
src/app/(app)/vendors/page.tsx
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import { getVendors } from "@/data/vendor.queries";
|
||||
import type { DataTableSearchParams } from "@/types/table.types";
|
||||
import { VendorTable } from "./_components/vendor-table";
|
||||
|
||||
interface Props {
|
||||
searchParams: Promise<DataTableSearchParams>;
|
||||
}
|
||||
|
||||
export default async function VendorsPage({ searchParams }: Props) {
|
||||
const session = await auth();
|
||||
if (!session?.user?.id) redirect("/login");
|
||||
|
||||
const params = await searchParams;
|
||||
const { data, pageCount, totalCount } = await getVendors(session.user.id, params);
|
||||
|
||||
return <VendorTable data={data} pageCount={pageCount} totalCount={totalCount} />;
|
||||
}
|
||||
Reference in New Issue
Block a user