feat(guide): proper order sorting & hidden
This commit is contained in:
@@ -23,6 +23,7 @@ import { guides } from "@/lib/db/schema";
|
||||
export default async function GuideEditPage({
|
||||
params,
|
||||
}: PageProps<"/admin/guide/[id]">) {
|
||||
if (!(await adminCheck())) redirect("/login");
|
||||
const { id } = await params;
|
||||
const [guide] = await db.select().from(guides).where(eq(guides.id, id));
|
||||
if (!guide) notFound();
|
||||
|
||||
@@ -21,6 +21,7 @@ import { db } from "@/lib/db";
|
||||
import { guides } from "@/lib/db/schema";
|
||||
|
||||
export default async function GuideCreatePage() {
|
||||
if (!(await adminCheck())) redirect("/login");
|
||||
const [{ maxOrder }] = await db
|
||||
.select({
|
||||
maxOrder: sql<number>`
|
||||
|
||||
Reference in New Issue
Block a user