You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to filter the documents of a relationship field it breaks.
When I type a letter to filter by title, it query by publishDate that is the defaultSort value of the collection.
I can't find a way to specify in the relationship field how to specify the field to use for the query.
To Reproduce
Add the block
Open the field relationship
In the network a GET request is sent
url: http://localhost:3000/api/posts
Query string:
depth: 0
draft: true
limit: 10
locale: it-IT
page: 1
sort: publishDate
status: 200
type in the filter of the relationship
In the network a new GET request is sent
url: http://localhost:3000/api/posts
Query string:
depth: 0
draft: true
limit: 10
locale: it-IT
page: 1
sort: publishDate
where[and][1][publishDate][like]: a
status: 500
In the server console the error that appear is
[15:35:51] ERROR (payload): TypeError: Cannot destructure property 'operator' of '(0 , _sanitizeQueryValue.sanitizeQueryValue)(...)' as it is undefined.
at buildSearchParam (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/buildSearchParams.ts:97:17)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async parseParams (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/parseParams.ts:60:35)
at async buildAndOrConditions (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/buildAndOrConditions.ts:29:22)
at async parseParams (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/parseParams.ts:43:33)
at async buildAndOrConditions (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/buildAndOrConditions.ts:29:22)
at async parseParams (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/parseParams.ts:43:33)
at async buildAndOrConditions (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/buildAndOrConditions.ts:29:22)
at async parseParams (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/parseParams.ts:43:33)
at async Function.buildQuery (/Users/matteotortelli/progetti/evoluzione/evoluzione-backend/node_modules/@payloadcms/db-mongodb/src/queries/buildQuery.ts:43:22)
Link to reproduction
Describe the Bug
When I try to filter the documents of a relationship field it breaks.
When I type a letter to filter by title, it query by publishDate that is the defaultSort value of the collection.
I can't find a way to specify in the relationship field how to specify the field to use for the query.
To Reproduce
http://localhost:3000/api/posts
http://localhost:3000/api/posts
Payload Version
2.14.2
Adapters and Plugins
The text was updated successfully, but these errors were encountered: