Skip to content

Commit a4b230a

Browse files
committed
Improvements for the REST API
1 parent 68889e9 commit a4b230a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Model/AbstractManagement.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public function update($id, $data)
120120
if (!empty($data['store_id'])) {
121121
$item->setStoreId((int)$data['store_id']);
122122
$item->setData('data_to_update', $data);
123+
} else {
124+
$item->setStoreId(0);
123125
}
124126

125127
$item->load($id);
@@ -176,11 +178,7 @@ public function get($id, $storeId = 0)
176178
{
177179
try {
178180
$item = $this->_itemFactory->create();
179-
180-
if ($storeId) {
181-
$item->setStoreId((int)$storeId);
182-
}
183-
181+
$item->setStoreId((int)$storeId);
184182
$item->load($id);
185183

186184
if (!$item->getId()) {
@@ -203,11 +201,7 @@ public function view($id, $storeId)
203201
{
204202
try {
205203
$item = $this->_itemFactory->create();
206-
207-
if ($storeId) {
208-
$item->setStoreId((int)$storeId);
209-
}
210-
204+
$item->setStoreId((int)$storeId);
211205
$item->getResource()->load($item, $id);
212206

213207
if (!$item->isVisibleOnStore($storeId)) {

0 commit comments

Comments
 (0)