This fixes many various issues that are already fixed in 3.0. Updates Drizzle to match beta to fix some issues https://github.com/payloadcms/payload/issues/4673 https://github.com/payloadcms/payload/issues/6845 https://github.com/payloadcms/payload/issues/6266, prev Drizzle update PR https://github.com/payloadcms/payload/pull/7460/ Ported PRs: - https://github.com/payloadcms/payload/pull/6158 - https://github.com/payloadcms/payload/pull/7900 - https://github.com/payloadcms/payload/pull/7962 (does include duplication fixes for blocks / arrays with specific for 2.0 method) - https://github.com/payloadcms/payload/pull/8355 - https://github.com/payloadcms/payload/pull/8456 - https://github.com/payloadcms/payload/pull/8331 (not in the commits list, as it was a clean merge) - https://github.com/payloadcms/payload/pull/8369 - https://github.com/payloadcms/payload/pull/7749 - https://github.com/payloadcms/payload/pull/8539 --------- Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com> Co-authored-by: James Mikrut <james@payloadcms.com>
43 lines
911 B
TypeScript
43 lines
911 B
TypeScript
import type { CollectionConfig } from 'payload/types'
|
|
|
|
export const NestedArray: CollectionConfig = {
|
|
slug: 'nested-arrays',
|
|
fields: [
|
|
{
|
|
name: 'arrayWithBlocks',
|
|
type: 'array',
|
|
localized: true,
|
|
fields: [
|
|
{
|
|
name: 'blocksWithinArray',
|
|
type: 'blocks',
|
|
blocks: [
|
|
{
|
|
slug: 'someBlock',
|
|
fields: [
|
|
{
|
|
name: 'relationWithinBlock',
|
|
type: 'relationship',
|
|
relationTo: 'localized-posts',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'arrayWithLocalizedRelation',
|
|
type: 'array',
|
|
fields: [
|
|
{
|
|
name: 'localizedRelation',
|
|
type: 'relationship',
|
|
localized: true,
|
|
relationTo: 'localized-posts',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|