Skip to content

Nested fields are not recognised as sortable values #73

Description

@jasperkennis

When a field is inside a row inside a collapsible field, it does not show up as one of the sortable props. I had the following definition (excerpt):

export const GeneratedContent: CollectionConfig = {
  fields: [
    {
      type: 'collapsible',
      label: 'Basic info',
      fields: [
        {
          type: 'row',
          fields: [
            {
              name: 'id',
              type: 'text',
              defaultValue: () => crypto.randomUUID(),
              admin: {
                readOnly: true,
                width: '50%',
              },
            },
            {
              name: 'post_date',
              type: 'date',
              admin: {
                description: 'Post date for the content (required when status is published)',
                date: {
                  pickerAppearance: 'dayAndTime',
                },
                width: '50%',
              },
            },
          ],
        },
      ],
    },
  ],
};

but post_date would not show as a valid value for sort in my docs on http://localhost:3000/api/docs#tag/generated-content/GET/api/generated_content. It also didn't get added to the yaml and json variants of the docs.

Moving the post_date definition outside of the row and collapsable solved that.

npm list payload
payload-cms@1.0.0 /Users/jasperkennis/Projects/mylocation
├─┬ payload-oapi@0.2.5
│ └── payload@3.63.0 deduped
└── payload@3.63.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions