### What? Make the document `id` available to server-rendered admin components that expect it—specifically `EditMenuItems` and `BeforeDocumentControls`—so `props.id` matches the official docs. ### Why? The docs show examples using `props.id`, but the runtime `serverProps` and TS types didn’t include it. This led to `undefined` at render time. ### How? - Add id to ServerProps and set it in renderDocumentSlots from req.routeParams.id. Fixes #13420
28 lines
549 B
TypeScript
28 lines
549 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { editMenuItemsSlug } from '../slugs.js'
|
|
|
|
export const EditMenuItems: CollectionConfig = {
|
|
slug: editMenuItemsSlug,
|
|
admin: {
|
|
components: {
|
|
edit: {
|
|
editMenuItems: [
|
|
{
|
|
path: '/components/EditMenuItems/index.js#EditMenuItems',
|
|
},
|
|
{
|
|
path: '/components/EditMenuItemsServer/index.js#EditMenuItemsServer',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
type: 'text',
|
|
},
|
|
],
|
|
}
|