Skip to content

Commit

Permalink
Fix default_value for attributes, rename endpoint DivanteLtd#7
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirPlastovets committed Sep 4, 2018
1 parent 4d89f04 commit 6ca3489
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function indexAction()

$productAttrDTO['id'] = intval($productAttr->getAttributeId());
$productAttrDTO['options'] = $options;
$productAttrDTO['default_value'] = (string)$productAttrDTO['default_value'];
$productAttrDTO['default_value'] = (int)$productAttrDTO['default_value'];
$productAttrDTO = $this->_filterDTO($productAttrDTO);
$attrList[] = $productAttrDTO;
}
Expand All @@ -64,7 +64,7 @@ public function indexAction()
/**
* Prepare attribute data for mappings
*/
public function attributeInfoAction()
public function productMappingAction()
{
if ($this->_authorize($this->getRequest())) {
$result = array();
Expand Down
2 changes: 1 addition & 1 deletion node-app/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"category_endpoint": "http://dockerized-magento.local/vsbridge/categories/index",
"taxrule_endpoint": "http://dockerized-magento.local/vsbridge/taxrules/index",
"attribute_endpoint": "http://dockerized-magento.local/vsbridge/attributes/index",
"attribute_data_endpoint": "http://dockerized-magento.local/vsbridge/attributes/attributeInfo"
"product_mapping_endpoint": "http://dockerized-magento.local/vsbridge/attributes/productMapping"
}
}
3 changes: 2 additions & 1 deletion node-app/src/meta/elastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ async function putMappings(db, indexName, next, token) {
properties: {
id: { type: "long" },
attribute_id: { type: "long" },
default_value: {type: "integer"},
options: {
properties: {
value: { type: "text", "index" : "not_analyzed" }
Expand Down Expand Up @@ -209,7 +210,7 @@ function getAttributeData(token) {
let promise = new Promise((resolve, reject) => {
console.log('*** Getting attribute data')
api.authWith(token);
api.get(config.vsbridge['attribute_data_endpoint']).type('json').end((resp) => {
api.get(config.vsbridge['product_mapping_endpoint']).type('json').end((resp) => {
if (resp.body && resp.body.code !== 200) { // unauthroized request
console.log(resp.body.result);
process.exit(-1)
Expand Down

0 comments on commit 6ca3489

Please sign in to comment.