perf : cache
This commit is contained in:
@@ -7,13 +7,14 @@ import { CreateGuideFlow } from "@/components/admin/create-guide-flow";
|
||||
import { AdminHeader } from "@/components/admin/admin-header";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { getAdminSession } from "@/lib/auth/server";
|
||||
import { getActiveCatalog, listGuideCards } from "@/lib/guides/queries";
|
||||
import { getCachedCatalogOptions } from "@/lib/cache/catalog";
|
||||
import { listGuideCards } from "@/lib/guides/queries";
|
||||
|
||||
export default async function CreateGuidePage() {
|
||||
await connection();
|
||||
if (!(await getAdminSession())) redirect("/auth/login?next=%2Fadmin");
|
||||
const [catalog, guides] = await Promise.all([
|
||||
getActiveCatalog(),
|
||||
getCachedCatalogOptions(),
|
||||
listGuideCards(),
|
||||
]);
|
||||
if (!catalog) redirect("/admin?sync=required");
|
||||
|
||||
Reference in New Issue
Block a user