* 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.
62 lines
1.1 KiB
TypeScript
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
|