feat: support any depth for relationships in findDistinct (#14090)
Follow up to https://github.com/payloadcms/payload/pull/14026 ```ts // Supported before const relationResult = await payload.findDistinct({ collection: 'posts', field: 'relation1.title' }) // Supported now const relationResult = await payload.findDistinct({ collection: 'posts', field: 'relation1.relation2.title' }) const relationResult = await payload.findDistinct({ collection: 'posts', field: 'relation1.relation2.relation3.title' }) ```
This commit is contained in:
@@ -54,6 +54,11 @@ export const getConfig: () => Partial<Config> = () => ({
|
||||
type: 'text',
|
||||
name: 'title',
|
||||
},
|
||||
{
|
||||
name: 'simple',
|
||||
type: 'relationship',
|
||||
relationTo: 'simple',
|
||||
},
|
||||
{
|
||||
type: 'tabs',
|
||||
tabs: [
|
||||
@@ -131,6 +136,11 @@ export const getConfig: () => Partial<Config> = () => ({
|
||||
name: 'categoryTitle',
|
||||
virtual: 'category.title',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
name: 'categorySimpleText',
|
||||
virtual: 'category.simple.text',
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
relationTo: 'categories',
|
||||
|
||||
Reference in New Issue
Block a user