This commit is contained in:
Ivan Rezchikov
2026-07-15 22:40:58 +03:00
parent db5823c593
commit bffc81c8aa
2 changed files with 1 additions and 3 deletions
-2
View File
@@ -4,14 +4,12 @@ import { formatDate } from "@/lib/utils";
import { ArchiveIcon, CalendarIcon, PencilLineIcon } from "lucide-react";
import { Metadata } from "next";
import Link from "next/link";
import { redirect } from "next/navigation";
export const metadata: Metadata = { title: "List of pages" };
export default async function List() {
const user = await getCurrentUser();
const isAdmin = user?.isAdmin;
if (!isAdmin) redirect("/");
const pagesPublished = await getPages("PAGE", "PUBLISHED");
const pagesArchived = isAdmin ? await getPages("PAGE", "ARCHIVED") : [];