diff --git a/inc/classes/BxDolSearch.php b/inc/classes/BxDolSearch.php index e60617268d..cd768f3a1b 100644 --- a/inc/classes/BxDolSearch.php +++ b/inc/classes/BxDolSearch.php @@ -540,17 +540,23 @@ function processingAPI () $sUnit = 'list'; if(in_array($this->sUnitViewDefault, ['showcase', 'gallery'])) $sUnit = 'card'; + + $aParams = [ + 'per_page' => $this->aCurrent['paginate']['perPage'], + 'start' => $this->aCurrent['paginate']['start'], + 'type' => $this->_sMode, + ]; + + if (isset($this->_aParams['category'])){ + $aParams['category'] = $this->_aParams['category']; + } return [ 'module' => $sModule, 'unit' => 'general-' . $sUnitType . '-' . $sUnit, 'request_url' => !empty($this->aCurrent['api_request_url']) ? $this->aCurrent['api_request_url'] : '/api.php?r=' . $sModule . '/browse/¶ms[]=', 'data' => defined('BX_API_PAGE') ? [] : $this->decodeData($this->getSearchData()), - 'params' => [ - 'per_page' => $this->aCurrent['paginate']['perPage'], - 'start' => $this->aCurrent['paginate']['start'], - 'type' => $this->_sMode, - ], + 'params' => $aParams ]; }