Files
payload/test/localization/collections/NestedArray/index.ts
James Mikrut ac10bad723 fix(db-postgres): nested localized arrays (#7962)
## Description

Fixes a bug with nested arrays within either localized blocks or arrays.
2024-08-29 15:01:53 +00:00

66 lines
1.7 KiB
TypeScript

import type { CollectionConfig } from 'payload'
export const NestedArray: CollectionConfig = {
slug: 'nested-arrays',
versions: {
drafts: true,
},
fields: [
{
type: 'tabs',
tabs: [
{
label: 'My Tab',
fields: [
{
name: 'arrayWithBlocks',
type: 'array',
localized: true,
fields: [
{
name: 'blocksWithinArray',
type: 'blocks',
blocks: [
{
slug: 'someBlock',
fields: [
{
name: 'relationWithinBlock',
type: 'relationship',
relationTo: 'localized-posts',
},
{
name: 'myGroup',
type: 'group',
fields: [
{
name: 'text',
type: 'text',
},
],
},
],
},
],
},
],
},
{
name: 'arrayWithLocalizedRelation',
type: 'array',
fields: [
{
name: 'localizedRelation',
type: 'relationship',
localized: true,
relationTo: 'localized-posts',
},
],
},
],
},
],
},
],
}