26 lines
434 B
TypeScript
26 lines
434 B
TypeScript
import { CollectionConfig } from 'payload/types';
|
|
|
|
const Products: CollectionConfig = {
|
|
slug: 'products',
|
|
admin: {
|
|
useAsTitle: 'productTitle',
|
|
},
|
|
access: {
|
|
read: () => true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'productTitle',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'picture',
|
|
type: 'relationship',
|
|
relationTo: 'media',
|
|
hasMany: false
|
|
}
|
|
],
|
|
};
|
|
|
|
export default Products; |