Files
payload/test/versions/globals/DisablePublish.ts
2023-11-20 16:26:49 -05:00

24 lines
461 B
TypeScript

import type { GlobalConfig } from '../../../packages/payload/src/globals/config/types'
import { disablePublishGlobalSlug } from '../slugs'
const DisablePublishGlobal: GlobalConfig = {
access: {
update: ({ data }) => {
return data._status !== 'published'
},
},
fields: [
{
name: 'title',
type: 'text',
},
],
slug: disablePublishGlobalSlug,
versions: {
drafts: true,
},
}
export default DisablePublishGlobal