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:
mtgerb
2022-09-20 14:40:55 +02:00
committed by GitHub
parent 0f39a80354
commit d6fce8d92a

View File

@@ -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,