Files
payload/test/versions/collections/CustomIDs.ts
Dan Ribbens 5d15955f83 fix: custom ids in versions (#4680)
* chore: scaffolds out fix for postgres issues with custom ids in versions

* fix(db-postgres): queryDrafts returns undefined doc.id

* chore(db-postgres): fix build

* fix: removes extra custom id field from  versions buildCollectionFields

* chore: comments test/versions seeding back in

* fix buildCollectionFields version group fields

* fix: id field can be edited after saving a document with custom ids

* chore: updates versions custom ID test

---------

Co-authored-by: PatrikKozak <patrik@payloadcms.com>
2024-01-04 13:05:10 -05:00

30 lines
558 B
TypeScript

import type { CollectionConfig } from '../../../packages/payload/src/collections/config/types'
import { customIDSlug } from '../slugs'
const CustomIDs: CollectionConfig = {
slug: customIDSlug,
admin: {
defaultColumns: ['id', 'title', 'createdAt'],
preview: () => 'https://payloadcms.com',
useAsTitle: 'id',
},
fields: [
{
name: 'id',
type: 'text',
},
{
name: 'title',
type: 'text',
label: 'Title',
},
],
versions: {
drafts: false,
maxPerDoc: 2,
},
}
export default CustomIDs