Files
payloadcms/test/versions/globals/DraftUnlimited.ts
Sasha a9553925f6 fix: add missed pagination property to findVersions and findGlobalVersions and handle it properly (#13763)
* The `pagination` property was missing in `findVersions` and
`findGlobalVersions` Local API operations, although the actual functions
did have it -
1b93c4becc/packages/payload/src/collections/operations/findVersions.ts (L25)
* The handling of the `pagination` property in those functions was
broken, this PR fixes it.
2025-09-16 17:05:54 -04:00

62 lines
1.1 KiB
TypeScript

import type { GlobalConfig } from 'payload'
import { draftUnlimitedGlobalSlug } from '../slugs.js'
const DraftUnlimitedGlobal: GlobalConfig = {
slug: draftUnlimitedGlobalSlug,
label: 'Draft Unlimited Global',
admin: {
preview: () => 'https://payloadcms.com',
components: {
views: {
edit: {
version: {
actions: ['/elements/GlobalVersionButton/index.js'],
},
versions: {
actions: ['/elements/GlobalVersionsButton/index.js'],
},
},
},
},
},
versions: {
max: 0,
drafts: {
schedulePublish: true,
},
},
access: {
read: ({ req: { user } }) => {
if (user) {
return true
}
return {
or: [
{
_status: {
equals: 'published',
},
},
{
_status: {
exists: false,
},
},
],
}
},
},
fields: [
{
name: 'title',
type: 'text',
required: true,
localized: true,
},
],
}
export default DraftUnlimitedGlobal