Compare commits

...

2 Commits

Author SHA1 Message Date
Patrik Kozak
b171c01f97 chore: revert validateQueryPaths adjustments 2024-07-31 11:58:41 -04:00
Patrik Kozak
6162ba1308 chore: stubs out updates for query validation when filtering by poly relationships w/ versions 2024-07-30 12:07:34 -04:00
2 changed files with 11 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ export async function validateQueryPaths({
const fields = flattenFields(
versionFields || (globalConfig || collectionConfig).fields,
) as FieldAffectingData[]
if (typeof where === 'object') {
const whereFields = flattenWhere(where)
// We need to determine if the whereKey is an AND, OR, or a schema path

View File

@@ -6,6 +6,10 @@ export const postsSlug = 'posts'
export const PostsCollection: CollectionConfig = {
defaultSort: 'title',
versions: {
// Drafts required to reproduce the issue
drafts: true,
},
fields: [
{
name: 'text',
@@ -15,6 +19,12 @@ export const PostsCollection: CollectionConfig = {
name: 'title',
type: 'text',
},
{
name: 'relatedPosts',
type: 'relationship',
// Polymorphic relationship required to reproduce the issue
relationTo: ['posts'],
},
{
name: 'associatedMedia',
access: {