Skip to content

Commit

Permalink
Simplify the queryString methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe authored Oct 27, 2024
1 parent 6cebf9b commit 0ab92b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
9 changes: 3 additions & 6 deletions src/Traits/Core/QueryStrings/HasQueryStringForFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ trait HasQueryStringForFilter

protected function queryStringHasQueryStringForFilter(): array
{
if ($this->queryStringForFilterIsEnabled()) {
return [
return ($this->queryStringForFilterIsEnabled()) ?
[
'appliedFilters' => ['except' => null, 'history' => false, 'keep' => false, 'as' => $this->getQueryStringAliasForFilter()],
'filterComponents' => ['except' => null, 'history' => false, 'keep' => false, 'as' => $this->getQueryStringAliasForFilter()],
];
}

return [];
] : [];
}

public function setupQueryStringStatusForFilter(): void
Expand Down
7 changes: 1 addition & 6 deletions src/Traits/Core/QueryStrings/HasQueryStringForSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ trait HasQueryStringForSearch

protected function queryStringHasQueryStringForSearch(): array
{
if ($this->queryStringForSearchEnabled() && $this->searchIsEnabled()) {
return [
'search' => ['except' => null, 'history' => false, 'keep' => false, 'as' => $this->getQueryStringAliasForSearch()],
];
}
return ($this->queryStringForSearchEnabled() && $this->searchIsEnabled()) ? [ 'search' => ['except' => null, 'history' => false, 'keep' => false, 'as' => $this->getQueryStringAliasForSearch()]] : [];

return [];
}

public function setupQueryStringStatusForSearch(): void
Expand Down

0 comments on commit 0ab92b4

Please sign in to comment.