fix: findDistinct with polymorphic relationships (#13875)
Fixes `findDistinct` with polymorphic relationships and also fixes a bug from https://github.com/payloadcms/payload/pull/13840 when `findDistinct` didn't work properly for `hasMany` relationships in mongodb if `sort` is the same as `field` --------- Co-authored-by: Patrik Kozak <35232443+PatrikKozak@users.noreply.github.com>
This commit is contained in:
@@ -198,6 +198,16 @@ export interface Post {
|
||||
title: string;
|
||||
category?: (string | null) | Category;
|
||||
categories?: (string | Category)[] | null;
|
||||
categoryPoly?: {
|
||||
relationTo: 'categories';
|
||||
value: string | Category;
|
||||
} | null;
|
||||
categoryPolyMany?:
|
||||
| {
|
||||
relationTo: 'categories';
|
||||
value: string | Category;
|
||||
}[]
|
||||
| null;
|
||||
categoryCustomID?: (number | null) | CategoriesCustomId;
|
||||
localized?: string | null;
|
||||
text?: string | null;
|
||||
@@ -827,6 +837,8 @@ export interface PostsSelect<T extends boolean = true> {
|
||||
title?: T;
|
||||
category?: T;
|
||||
categories?: T;
|
||||
categoryPoly?: T;
|
||||
categoryPolyMany?: T;
|
||||
categoryCustomID?: T;
|
||||
localized?: T;
|
||||
text?: T;
|
||||
|
||||
Reference in New Issue
Block a user