wip: refactor sections

This commit is contained in:
2025-09-24 15:14:48 -04:00
parent b2b9b2ba8f
commit 9af11d00cf
9 changed files with 56 additions and 59 deletions

View File

@@ -3,11 +3,12 @@ import { createSSRApp, h } from "vue";
import type { TheSectionFragment } from "#graphql-operations";
export default defineEventHandler(async (event) => {
const { fieldGroupName, ...attrs } = await readBody<TheSectionFragment>(event);
try {
const section = await readBody<TheSectionFragment>(event);
const { component, attrs } = useSection(section);
const app = createSSRApp({
render() {
return h(sectionsMap[fieldGroupName as FieldGroupName], attrs);
return h(component, attrs);
},
});
const html = await renderToString(app);