remove: unnecessary code
This commit is contained in:
@@ -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(),
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user