church-website/src/collections/ContactPerson.ts
Benno Tielen ed273454a3
Some checks are pending
Deploy / deploy (push) Waiting to run
feature: contact persons
2026-03-20 00:01:36 +01:00

57 lines
No EOL
974 B
TypeScript

import { CollectionConfig } from 'payload'
import { hide, isAdminOrEmployee } from '@/collections/access/admin'
export const ContactPerson: CollectionConfig = {
slug: 'contactPerson',
labels: {
singular: {
de: 'Ansprechpartner'
},
plural: {
de: "Ansprechpartner"
}
},
fields: [
{
name: 'photo',
type: 'upload',
relationTo: 'media',
},
{
name: 'name',
type: 'text',
required: true,
label: {
de: "Name"
}
},
{
name: 'role',
type: 'text',
label: {
de: 'Funktion',
},
},
{
name: 'email',
type: 'email',
},
{
name: 'telephone',
type: 'text',
label: {
de: 'Telefon'
}
}
],
admin: {
useAsTitle: "name",
hidden: hide
},
access: {
read: () => true,
create: isAdminOrEmployee(),
update: isAdminOrEmployee(),
delete: isAdminOrEmployee(),
},
}