Skip to content

Commit 9250ce6

Browse files
committed
fix categores list
1 parent 7928d0a commit 9250ce6

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

Model/Resolver/Categories.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@ public function resolve(
7979
}
8080
$searchResult = $this->categoryInterface->getList($searchCriteria, $search);
8181
$totalPages = $args['pageSize'] ? ((int)ceil($searchResult->getTotalCount() / $args['pageSize'])) : 0;
82-
82+
$items = [];
83+
foreach ($searchResult->getItems() as $_item) {
84+
$items[] = $_item->toArray();
85+
}
8386
return [
8487
'total_count' => $searchResult->getTotalCount(),
85-
'items' => $searchResult->getItems(),
88+
'items' => $items,
8689
'page_info' => [
8790
'page_size' => $args['pageSize'],
8891
'current_page' => $args['currentPage'],

Model/Resolver/CategoryImageResolver.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,11 @@ public function __construct(
5959
}
6060

6161
/**
62-
* @param Field $field
63-
* @param ContextInterface $context
64-
* @param ResolveInfo $info
65-
* @param array|null $value
66-
* @param array|null $args
67-
* @return array|Value|mixed
68-
* @throws LocalizedException
62+
* @inheritDoc
6963
*/
7064
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
7165
{
72-
if (isset($value['image']) && $value['image']) {
66+
if (is_array($value) && isset($value['image']) && $value['image']) {
7367
return $this->_storeManager->getStore()->getBaseUrl(
7468
\Magento\Framework\UrlInterface::URL_TYPE_MEDIA
7569
) . $value['image'];

Model/Resolver/CategoryQuestionResolver.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,7 @@ public function __construct(
5050
}
5151

5252
/**
53-
* @param Field $field
54-
* @param ContextInterface $context
55-
* @param ResolveInfo $info
56-
* @param array|null $value
57-
* @param array|null $args
58-
* @return array|Value|mixed
59-
* @throws \Magento\Framework\Exception\LocalizedException
53+
* @inheritDoc
6054
*/
6155
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
6256
{

0 commit comments

Comments
 (0)