diff --git a/app/(payload)/layout.tsx b/app/(payload)/layout.tsx index 4b7d2525e7..c204f76bc9 100644 --- a/app/(payload)/layout.tsx +++ b/app/(payload)/layout.tsx @@ -1,7 +1,7 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ // import '@payloadcms/ui/styles.css' // Uncomment this line if `@payloadcms/ui` in `tsconfig.json` points to `/ui/dist` instead of `/ui/src` -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -15,7 +15,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/docs/admin/server-functions.mdx b/docs/admin/server-functions.mdx index 99ff9f9c3c..436d014194 100644 --- a/docs/admin/server-functions.mdx +++ b/docs/admin/server-functions.mdx @@ -94,7 +94,7 @@ In order for Payload to support dynamic Sever Functions, a single handler is pla ```ts /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -110,7 +110,7 @@ type Args = { } // highlight-start -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/_template/src/app/(payload)/layout.tsx b/templates/_template/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/_template/src/app/(payload)/layout.tsx +++ b/templates/_template/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/blank/src/app/(payload)/layout.tsx b/templates/blank/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/blank/src/app/(payload)/layout.tsx +++ b/templates/blank/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/vercel-postgres/src/app/(payload)/layout.tsx b/templates/vercel-postgres/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/vercel-postgres/src/app/(payload)/layout.tsx +++ b/templates/vercel-postgres/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/website/src/app/(payload)/layout.tsx b/templates/website/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/website/src/app/(payload)/layout.tsx +++ b/templates/website/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/with-payload-cloud/src/app/(payload)/layout.tsx b/templates/with-payload-cloud/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/with-payload-cloud/src/app/(payload)/layout.tsx +++ b/templates/with-payload-cloud/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/with-postgres/src/app/(payload)/layout.tsx b/templates/with-postgres/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/with-postgres/src/app/(payload)/layout.tsx +++ b/templates/with-postgres/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/with-vercel-mongodb/src/app/(payload)/layout.tsx b/templates/with-vercel-mongodb/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/with-vercel-mongodb/src/app/(payload)/layout.tsx +++ b/templates/with-vercel-mongodb/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/templates/with-vercel-postgres/src/app/(payload)/layout.tsx b/templates/with-vercel-postgres/src/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/templates/with-vercel-postgres/src/app/(payload)/layout.tsx +++ b/templates/with-vercel-postgres/src/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/test/admin-root/app/(payload)/layout.tsx b/test/admin-root/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/test/admin-root/app/(payload)/layout.tsx +++ b/test/admin-root/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/test/app/(payload)/layout.tsx b/test/app/(payload)/layout.tsx index ca89769df4..a6036a3700 100644 --- a/test/app/(payload)/layout.tsx +++ b/test/app/(payload)/layout.tsx @@ -1,6 +1,6 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' import { RootLayout } from '@payloadcms/next/layouts' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args, diff --git a/test/live-preview/app/(payload)/layout.tsx b/test/live-preview/app/(payload)/layout.tsx index ca89769df4..c1e286e380 100644 --- a/test/live-preview/app/(payload)/layout.tsx +++ b/test/live-preview/app/(payload)/layout.tsx @@ -1,9 +1,9 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ClientServerFunction } from 'payload' +import type { ServerFunctionClient } from 'payload' import config from '@payload-config' -import { RootLayout } from '@payloadcms/next/layouts' +import { RootLayout } from '@payloadcms/next/layouts/Root/index.js' import { handleServerFunctions } from '@payloadcms/next/utilities' import React from 'react' @@ -14,7 +14,7 @@ type Args = { children: React.ReactNode } -const serverFunction: ClientServerFunction = async function (args) { +const serverFunction: ServerFunctionClient = async function (args) { 'use server' return handleServerFunctions({ ...args,