remove: unnecessary code

This commit is contained in:
Dominik Natter
2025-03-26 14:20:05 +01:00
parent 18ab55600b
commit 56e90c202d
200 changed files with 9738 additions and 11700 deletions

View File

@@ -1,8 +1,5 @@
import type { CollectionConfig } from 'payload'
import { anyone } from '../access/anyone'
import { authenticated } from '../access/authenticated'
import { slugField } from '@/fields/slug'
export const Papers: CollectionConfig = {
slug: 'papers',
@@ -11,10 +8,7 @@ export const Papers: CollectionConfig = {
plural: 'Diplomarbeiten',
},
access: {
create: authenticated,
delete: authenticated,
read: anyone,
update: authenticated,
},
admin: {
useAsTitle: 'title',
@@ -116,6 +110,7 @@ export const Papers: CollectionConfig = {
],
validate: (authors) => {
// @ts-ignore
const leaders = authors.filter(author => author.position === 'leader')
if (leaders.length > 1) {
return 'Only one author can be the project leader.'
@@ -123,6 +118,5 @@ export const Papers: CollectionConfig = {
return true
},
},
...slugField(),
],
}