Skip to content

Commit

Permalink
#4148 - Build-in API support (search changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov committed Sep 28, 2023
1 parent 3fc46c6 commit 0dff12a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions inc/classes/BxDolSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/&params[]=',
'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
];
}

Expand Down

0 comments on commit 0dff12a

Please sign in to comment.