29 lines
654 B
TypeScript
29 lines
654 B
TypeScript
import { CollectionConfig } from 'payload/types';
|
|
import { geoPickerField } from "../customFields/geoPicker/field";
|
|
|
|
const Makers: CollectionConfig = {
|
|
slug: 'makers',
|
|
admin: {
|
|
useAsTitle: 'name',
|
|
},
|
|
access: {
|
|
read: () => true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'name', // required
|
|
type: 'text', // required
|
|
required: true,
|
|
},
|
|
geoPickerField,
|
|
{
|
|
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; |