Re-ordering documents with drafts uses `payload.update()` with `select:
{ id: true }` and that causes draft versions of those docs to be updated
without any data. I've removed the `select` optimization to prevent data
loss.
Fixes #12097
29 lines
440 B
TypeScript
29 lines
440 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
export const draftsSlug = 'drafts'
|
|
|
|
export const DraftsCollection: CollectionConfig = {
|
|
slug: draftsSlug,
|
|
admin: {
|
|
useAsTitle: 'text',
|
|
},
|
|
orderable: true,
|
|
versions: {
|
|
drafts: true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'number',
|
|
type: 'number',
|
|
},
|
|
{
|
|
name: 'number2',
|
|
type: 'number',
|
|
},
|
|
],
|
|
}
|