32 lines
669 B
TypeScript
32 lines
669 B
TypeScript
import { CollectionConfig } from 'payload/types';
|
|
|
|
const Makers: CollectionConfig = {
|
|
slug: 'makers',
|
|
// admin: {
|
|
// useAsTitle: 'email',
|
|
// },
|
|
access: {
|
|
read: () => true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'name', // required
|
|
type: 'text', // required
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'location',
|
|
type: 'point',
|
|
label: 'Location',
|
|
},
|
|
{
|
|
name: 'products', // required
|
|
type: 'relationship', // required
|
|
relationTo: 'products', // required
|
|
hasMany: true,
|
|
// TODO: make the name of the product visible in the dropdown
|
|
}
|
|
],
|
|
};
|
|
|
|
export default Makers; |