Feat: Adding the collections

This commit is contained in:
augurk
2023-01-24 13:20:27 +01:00
parent bdf11ce3b6
commit 23a8bf752d
6 changed files with 178 additions and 2 deletions

32
src/collections/Makers.ts Normal file
View File

@ -0,0 +1,32 @@
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;