Files
payload/test/fields/collections/SelectVersions/index.ts
Sasha 3ad56cd86f fix(db-postgres): select hasMany: true with autosave doesn't work properly (#11012)
Previously, select fields with `hasMany: true` didn't save properly in
Postgres on autosave.
2025-02-06 23:47:53 +02:00

48 lines
951 B
TypeScript

import type { CollectionConfig } from 'payload'
import { selectVersionsFieldsSlug } from '../../slugs.js'
const SelectVersionsFields: CollectionConfig = {
slug: selectVersionsFieldsSlug,
versions: { drafts: { autosave: true } },
fields: [
{
type: 'select',
hasMany: true,
options: ['a', 'b', 'c', 'd'],
name: 'hasMany',
},
{
type: 'array',
name: 'array',
fields: [
{
type: 'select',
hasMany: true,
options: ['a', 'b', 'c'],
name: 'hasManyArr',
},
],
},
{
type: 'blocks',
name: 'blocks',
blocks: [
{
slug: 'block',
fields: [
{
type: 'select',
hasMany: true,
options: ['a', 'b', 'c'],
name: 'hasManyBlocks',
},
],
},
],
},
],
}
export default SelectVersionsFields