39 lines
682 B
TypeScript
39 lines
682 B
TypeScript
import type { CollectionConfig } from 'payload/types'
|
|
|
|
import { mediaSlug } from '../Media/index.js'
|
|
|
|
export const postsSlug = 'posts'
|
|
|
|
export const PostsCollection: CollectionConfig = {
|
|
slug: postsSlug,
|
|
admin: {
|
|
useAsTitle: 'text',
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'richText',
|
|
type: 'richText',
|
|
},
|
|
// {
|
|
// type: 'row',
|
|
// fields: [],
|
|
// },
|
|
// {
|
|
// name: 'associatedMedia',
|
|
// type: 'upload',
|
|
// access: {
|
|
// create: () => true,
|
|
// update: () => false,
|
|
// },
|
|
// relationTo: mediaSlug,
|
|
// },
|
|
],
|
|
versions: {
|
|
drafts: true,
|
|
},
|
|
}
|