* 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>
30 lines
558 B
TypeScript
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
|