54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import type { CollectionConfig } from 'payload';
|
|
import { authenticated } from '../access/authenticated';
|
|
import { anyone } from '../access/anyone';
|
|
|
|
export const Team: CollectionConfig = {
|
|
slug: 'team',
|
|
admin: {
|
|
useAsTitle: 'name',
|
|
defaultColumns: ['name', 'position', 'email'],
|
|
},
|
|
access: {
|
|
read: anyone,
|
|
create: authenticated,
|
|
update: authenticated,
|
|
delete: authenticated,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'name',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'position',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'email',
|
|
type: 'email',
|
|
},
|
|
{
|
|
name: 'phone',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'image',
|
|
type: 'upload',
|
|
relationTo: 'media',
|
|
},
|
|
{
|
|
name: 'branch',
|
|
type: 'select',
|
|
options: [
|
|
{ label: 'E-TIB GmbH', value: 'e-tib' },
|
|
{ label: 'Ingenieurgesellschaft', value: 'ing' },
|
|
{ label: 'Bohrtechnik', value: 'bohr' },
|
|
{ label: 'Verwaltung', value: 'verw' },
|
|
],
|
|
required: true,
|
|
},
|
|
],
|
|
};
|