GX-Bug #66581 » products-in-categories-api-fix.patch
src/GXMainComponents/Controllers/Api/v2/CategoriesApiV2Controller.inc.php (date 1576251904588) | ||
---|---|---|
592 | 592 |
|
593 | 593 |
return $response; |
594 | 594 |
} |
595 |
|
|
596 |
|
|
597 |
/** |
|
598 |
* @param array $criteria |
|
599 |
* |
|
600 |
* @return bool |
|
601 |
* @throws HttpApiV2Exception |
|
602 |
*/ |
|
603 |
protected function _mapResponse(array $criteria) |
|
604 |
{ |
|
605 |
if(count($this->uri) !== 3 || ($this->uri[0] !== 'categories' && $this->uri[2] !== 'products')) { |
|
606 |
return parent::_mapResponse($criteria); |
|
607 |
} |
|
608 |
|
|
609 |
/** @var ProductsApiV2Controller $controller */ |
|
610 |
$controller = MainFactory::create($criteria['products'], $this->api, $this->uri); |
|
611 |
$controller->getByCategories($this->uri[1]); |
|
612 |
|
|
613 |
return true; |
|
614 |
} |
|
595 | 615 |
} |