mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Add support for <collection>.items.query filter hook (#15611)
* fix items.query filtering for a collection * fix linter error Co-authored-by: Matthias Gerbershagen <m_gerbersh09@informatik.uni-kl.de> Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
This commit is contained in:
@@ -291,7 +291,9 @@ export class ItemsService<Item extends AnyItem = AnyItem> implements AbstractSer
|
||||
const updatedQuery =
|
||||
opts?.emitEvents !== false
|
||||
? await emitter.emitFilter(
|
||||
`${this.eventScope}.query`,
|
||||
this.eventScope === 'items'
|
||||
? ['items.query', `${this.collection}.items.query`]
|
||||
: `${this.eventScope}.query`,
|
||||
query,
|
||||
{
|
||||
collection: this.collection,
|
||||
|
||||
Reference in New Issue
Block a user