Skip to content

Commit

Permalink
filter by search
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Dec 14, 2023
1 parent 47e0fae commit 4172762
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Joomla\Component\Categories\Api\Controller;

use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\MVC\Controller\ApiController;
use Joomla\CMS\Table\Category;

Expand Down Expand Up @@ -124,6 +125,13 @@ public function displayItem($id = null)
*/
public function displayList()
{
$apiFilterInfo = $this->input->get('filter', [], 'array');
$filter = InputFilter::getInstance();

if (\array_key_exists('search', $apiFilterInfo)) {
$this->modelState->set('filter.search', $filter->clean($apiFilterInfo['search'], 'STRING'));
}

$this->modelState->set('filter.extension', $this->getExtensionFromInput());

return parent::displayList();
Expand Down

0 comments on commit 4172762

Please sign in to comment.