Skip to content

Commit df7da06

Browse files
author
Marius
committed
Add relations aggregates to sortable
1 parent fd8ec0b commit df7da06

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Http/Middleware/Decorators/AbstractDecoratorMiddleware.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,13 @@ protected function getListNewContent(Request $request, array $content, array $co
204204
}
205205

206206
$newContent['filterable'] = $this->decorator->getFilters();
207-
$newContent['sortable'] = $indexedSortable ?? $this->decorator->getFilters();
207+
$newContent['sortable'] = \array_merge(
208+
$indexedSortable ?? $this->decorator->getFilters(),
209+
\array_map(fn (string $rel): string => $rel .
210+
$this->decorator::EXIST_SUFFIX, $this->decorator->getExistRelations()),
211+
\array_map(fn (string $rel): string => $rel .
212+
$this->decorator::COUNT_SUFFIX, $this->decorator->getCountRelations())
213+
);
208214

209215
return $newContent;
210216
}

0 commit comments

Comments
 (0)