perf : increase admin page speed
This commit is contained in:
@@ -11,7 +11,7 @@ import { EditorPresence } from "@/components/admin/editor-presence";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { getAdminSession } from "@/lib/auth/server";
|
||||
import {
|
||||
getActiveCatalog,
|
||||
getCatalogOptions,
|
||||
getAdminGuideContent,
|
||||
getGuideEditorHeader,
|
||||
} from "@/lib/guides/queries";
|
||||
@@ -53,13 +53,11 @@ export default async function StructuredEditorPage({
|
||||
?? guide.sections.find((section) => section.slug === page)?.title
|
||||
?? page;
|
||||
const [catalog, content] = await Promise.all([
|
||||
getActiveCatalog(),
|
||||
getAdminGuideContent(guide.slug),
|
||||
getCatalogOptions(),
|
||||
getAdminGuideContent(guide.slug, page),
|
||||
]);
|
||||
if (!catalog || !content) notFound();
|
||||
const guideCharacter = catalog.characters.find(
|
||||
(item) => item.key === guide.characterKey,
|
||||
);
|
||||
const guideCharacter = content.character;
|
||||
return (
|
||||
<div className="min-h-svh">
|
||||
<AdminHeader />
|
||||
|
||||
Reference in New Issue
Block a user