fixes
This commit is contained in:
@@ -4,14 +4,12 @@ import { formatDate } from "@/lib/utils";
|
|||||||
import { ArchiveIcon, CalendarIcon, PencilLineIcon } from "lucide-react";
|
import { ArchiveIcon, CalendarIcon, PencilLineIcon } from "lucide-react";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export const metadata: Metadata = { title: "List of pages" };
|
export const metadata: Metadata = { title: "List of pages" };
|
||||||
|
|
||||||
export default async function List() {
|
export default async function List() {
|
||||||
const user = await getCurrentUser();
|
const user = await getCurrentUser();
|
||||||
const isAdmin = user?.isAdmin;
|
const isAdmin = user?.isAdmin;
|
||||||
if (!isAdmin) redirect("/");
|
|
||||||
|
|
||||||
const pagesPublished = await getPages("PAGE", "PUBLISHED");
|
const pagesPublished = await getPages("PAGE", "PUBLISHED");
|
||||||
const pagesArchived = isAdmin ? await getPages("PAGE", "ARCHIVED") : [];
|
const pagesArchived = isAdmin ? await getPages("PAGE", "ARCHIVED") : [];
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function Footer() {
|
|||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<Link href="/" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">Main</Link>
|
<Link href="/" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">Main</Link>
|
||||||
<Link href="/news" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">News</Link>
|
<Link href="/news" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">News</Link>
|
||||||
<Link href="/page/congress" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">The Congress</Link>
|
<Link href="/pages" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">List of pages</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<Link href="/page/president" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">President</Link>
|
<Link href="/page/president" className="text-black/60 cursor-pointer hover:underline underline-offset-8 decoration-2">President</Link>
|
||||||
|
|||||||
Reference in New Issue
Block a user