fix(cms): add Payload REST API + GraphQL route handlers, revert to inline serverFunction

This commit is contained in:
2026-04-06 15:57:04 +02:00
parent 6ded84c6de
commit 41a35b5460
4 changed files with 36 additions and 16 deletions

View File

@@ -2,17 +2,26 @@
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import config from "@payload-config";
import "@payloadcms/next/css";
import { RootLayout } from "@payloadcms/next/layouts";
import type { ServerFunctionClient } from "payload";
import { handleServerFunctions, RootLayout } from "@payloadcms/next/layouts";
import React from "react";
import { importMap } from "./admin/importMap.js";
import { serverFunction } from "./serverFunction";
import "./custom.scss";
type Args = {
children: React.ReactNode;
};
const serverFunction: ServerFunctionClient = async function (args) {
"use server";
return handleServerFunctions({
...args,
config,
importMap,
});
};
const Layout = ({ children }: Args) => (
<RootLayout
config={config}