25 lines
490 B
TypeScript
25 lines
490 B
TypeScript
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
|
|
|
import { mediaSlug } from '../Media'
|
|
|
|
export const postsSlug = 'posts'
|
|
|
|
export const PostsCollection: CollectionConfig = {
|
|
slug: postsSlug,
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'associatedMedia',
|
|
type: 'upload',
|
|
relationTo: mediaSlug,
|
|
access: {
|
|
create: () => true,
|
|
update: () => false,
|
|
},
|
|
},
|
|
],
|
|
}
|