When selecting query presets from the list drawer, all query presets are available for selection, even if unrelated to the underlying collection. When selecting one of these presets, the list view will crash with client-side exceptions because the columns and filters that are applied are incompatible. The fix is to the thread `filterOptions` through the query presets drawer. This will ensure that only related collections are shown.
22 lines
354 B
TypeScript
22 lines
354 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { postsSlug } from '../../slugs.js'
|
|
|
|
export const Posts: CollectionConfig = {
|
|
slug: postsSlug,
|
|
admin: {
|
|
useAsTitle: 'text',
|
|
},
|
|
enableQueryPresets: true,
|
|
lockDocuments: false,
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
],
|
|
versions: {
|
|
drafts: true,
|
|
},
|
|
}
|