Skip to content

Commit c563c28

Browse files
committed
Run onListing callback after applying sort/filtering to the query
1 parent 7858566 commit c563c28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Endpoint/Index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function handle(Context $context): ResponseInterface
5959

6060
$query = $adapter->newQuery($context);
6161

62-
run_callbacks($schema->getListeners('listing'), [$query, $context]);
6362
run_callbacks($schema->getListeners('scope'), [$query, $context]);
6463

6564
$include = $this->getInclude($context);
@@ -68,6 +67,8 @@ public function handle(Context $context): ResponseInterface
6867
$this->sort($query, $context);
6968
$this->filter($query, $context);
7069

70+
run_callbacks($schema->getListeners('listing'), [$query, $context]);
71+
7172
$total = $schema->isCountable() ? $adapter->count($query) : null;
7273
$models = $adapter->get($query);
7374

0 commit comments

Comments
 (0)