Skip to content

Commit 8df9ba3

Browse files
committed
Final touch
1 parent f7924e7 commit 8df9ba3

15 files changed

+11
-21
lines changed

magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function _result($code, $result){
6060
$this->getResponse()->setBody(json_encode(array(
6161
'code' => $code,
6262
'result' => $result
63-
)))->setHttpResponseCode($code);
63+
), JSON_NUMERIC_CHECK))->setHttpResponseCode($code)->setHeader('Content-Type', 'application/json');
6464
}
6565
}
6666
?>

magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AttributesController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ public function indexAction()
77
if($this->_authorize($this->getRequest())) {
88

99
$params = $this->_processParams($this->getRequest());
10-
$this->getResponse()->setHttpResponseCode(200);
11-
$this->getResponse()->setHeader('Content-Type', 'application/json');
12-
1310
$productAttrs = Mage::getResourceModel('catalog/product_attribute_collection');
1411

1512
$attrList = array();
@@ -34,7 +31,7 @@ public function indexAction()
3431

3532
$attrList[] = $productAttrDTO;
3633
}
37-
$this->getResponse()->setBody(json_encode($attrList, JSON_NUMERIC_CHECK));
34+
$this->_result(200, $attrList);
3835
}
3936
}
4037
}

magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AuthController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ class Divante_VueStorefrontBridge_AuthController extends Divante_VueStorefrontBr
55
{
66
public function adminAction()
77
{
8-
$this->getResponse()->setHeader('Content-Type', 'application/json');
98
if($this->getRequest()->getMethod() !== 'POST'){
109
return $this->_result(500, 'Only POST method allowed');
1110
} else {

magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/CategoriesController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ public function indexAction()
3232
if ($this->_authorize($this->getRequest())) {
3333

3434
$params = $this->_processParams($this->getRequest());
35-
$this->getResponse()->setHttpResponseCode(200);
36-
$this->getResponse()->setHeader('Content-Type', 'application/json');
3735
$categories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')->setPage($params['page'], $params['pageSize'])->load(); //$helper->getStoreCategories();
3836

3937
$catList = array();
4038
foreach ($categories as $category) {
4139
$catList[] = _processCategory($category);
4240
}
43-
$this->getResponse()->setBody(json_encode($catList, JSON_NUMERIC_CHECK));
41+
$this->_result(200, $catList);
4442
}
4543
}
4644
}

magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/ProductsController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ public function indexAction()
88
if($this->_authorize($this->getRequest())) {
99

1010
$params = $this->_processParams($this->getRequest());
11-
$this->getResponse()->setHttpResponseCode(200);
12-
$this->getResponse()->setHeader('Content-Type', 'application/json');
13-
1411
$confChildBlacklist = array('entity_id', 'id', 'type_id', 'updated_at', 'created_at', 'stock_item', 'short_description', 'page_layout', 'news_from_date', 'news_to_date', 'meta_description', 'meta_keyword', 'meta_title', 'description', 'attribute_set_id', 'entity_type_id', 'has_options', 'required_options');
1512

1613
$result = array();
@@ -72,7 +69,7 @@ public function indexAction()
7269
$result[] = $productDTO;
7370
}
7471

75-
$this->getResponse()->setBody(json_encode($result, JSON_NUMERIC_CHECK));
72+
$this->_result(200, $result);
7673
}
7774
}
7875
}

magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/TaxrulesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function indexAction()
4444
$taxRules[] = $taxRuleDTO;
4545
}
4646
}
47-
$this->getResponse()->setBody(json_encode($taxRules, JSON_NUMERIC_CHECK));
47+
$this->_result(200, $taxRules);
4848
}
4949
}
5050
}

node-app/doc/Pimcore2vuestorefront-architecture-draw-io.xml

Lines changed: 0 additions & 1 deletion
This file was deleted.
-66.3 KB
Binary file not shown.

node-app/doc/setup-success.png

-121 KB
Binary file not shown.

node-app/doc/setup.png

-112 KB
Binary file not shown.

0 commit comments

Comments
 (0)