Skip to content

Commit

Permalink
wip: fix bug in filter and sorter
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan Deeb committed Jul 4, 2024
1 parent b78b457 commit acb936b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Logic/Resolvers/FilterResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function setFilters(FilterUI|array $filters): self
public function apply(Builder $query): Builder
{
foreach ($this->filters as $filter) {
$fields = $filter->fields();
$fields = app($filter)->fields();
$this->handleFields($query, $fields);

}
Expand Down Expand Up @@ -89,7 +89,7 @@ public function render(): array
{
$resultFields = [];
foreach ($this->filters as $filter) {
$fields = $filter->fields();
$fields = app($filter)->fields();
foreach ($fields as $field) {
$resultFields[$field->field] = $this->renderSingleField($field);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Logic/Resolvers/SortResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function setSorters(SortUI|array $sorts): self
public function apply(Builder $query): Builder
{
foreach ($this->sorts as $sort) {
$fields = $sort->fields();
$fields = app($sort)->fields();
$this->handleFields($query, $fields);
}

Expand Down Expand Up @@ -74,7 +74,7 @@ public function render(): array
{
$resultFields = [];
foreach ($this->sorts as $sort) {
$fields = $sort->fields();
$fields = app($sort)->fields();
foreach ($fields as $field) {
$resultFields[$field->field] = $this->renderSingleField($field);
}
Expand Down

0 comments on commit acb936b

Please sign in to comment.