Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 9b26913

Browse files
author
Roman Glushko
committed
#31 Made it possible to return active pages only
1 parent 94c904e commit 9b26913

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/code/Magento/CmsGraphQl/Model/Resolver/Cms/CmsPageDataProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ public function getCmsPageById(int $cmsPageId) : array
6060
{
6161
try {
6262
$cmsPageModel = $this->cmsPageRepository->getById($cmsPageId);
63+
64+
if (!$cmsPageModel->isActive()) {
65+
throw new NoSuchEntityException();
66+
}
67+
6368
} catch (NoSuchEntityException $e) {
6469
// No error should be thrown, null result should be returned
6570
return [];

0 commit comments

Comments
 (0)