This change adds support for sort with multiple fields in local API and REST API. Related discussion #2089 Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
22 lines
383 B
TypeScript
22 lines
383 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
export const defaultSortSlug = 'default-sort'
|
|
|
|
export const DefaultSortCollection: CollectionConfig = {
|
|
slug: defaultSortSlug,
|
|
admin: {
|
|
useAsTitle: 'text',
|
|
},
|
|
defaultSort: ['number', '-text'],
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'number',
|
|
type: 'number',
|
|
},
|
|
],
|
|
}
|