Skip to content

Commit 52f1887

Browse files
author
Bohdan Berezhniy
committed
in order to get localization via api
1 parent 22a78fc commit 52f1887

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Model/PostRepository.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ public function save(Post $post)
120120
public function getById($postId, $editMode = false, $storeId = null, $forceReload = false)
121121
{
122122
$post = $this->postFactory->create();
123+
124+
if ($storeId) {
125+
$post->setStoreId($storeId);
126+
}
127+
123128
$this->postResourceModel->load($post, $postId);
129+
124130
if (!$post->getId()) {
125131
throw new NoSuchEntityException(__('Requested item doesn\'t exist'));
126132
}

0 commit comments

Comments
 (0)