Files
payload/test/localization/collections/Blocks/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

54 lines
1.2 KiB
TypeScript

import type { CollectionConfig } from 'payload'
export const blocksCollectionSlug = 'blocks-fields'
export const BlocksCollection: CollectionConfig = {
slug: blocksCollectionSlug,
fields: [
{
name: 'content',
label: 'Content',
type: 'blocks',
localized: true,
blocks: [
{
slug: 'blockInsideBlock',
fields: [
{
name: 'content',
type: 'blocks',
blocks: [
{
slug: 'textBlock',
fields: [
{
name: 'text',
type: 'text',
},
],
},
],
},
{
name: 'array',
type: 'array',
fields: [
{
name: 'link',
type: 'group',
fields: [
{
name: 'label',
type: 'text',
},
],
},
],
},
],
},
],
},
],
}