import { CollectionConfig } from 'payload' import { revalidateTag } from 'next/cache' import { isAdminOrEmployee } from '@/collections/access/admin' export const Prayers: CollectionConfig = { slug: 'prayers', labels: { singular: { de: 'Stoßgebet', }, plural: { de: 'Stoßgebete', }, }, fields: [ { name: 'text', type: 'text', required: true, label: { de: 'Gebet', }, }, ], admin: { useAsTitle: 'text', }, access: { read: () => true, create: isAdminOrEmployee(), update: isAdminOrEmployee(), delete: isAdminOrEmployee(), }, hooks: { afterChange: [() => revalidateTag('prayers')], afterDelete: [() => revalidateTag('prayers')], }, }