diff --git a/modules/order/front/catalog/index.js b/modules/order/front/catalog/index.js index d0df71ea0..761fda7a3 100644 --- a/modules/order/front/catalog/index.js +++ b/modules/order/front/catalog/index.js @@ -55,8 +55,8 @@ class Controller extends Section { if (this.$params.typeId) this.typeId = parseInt(this.$params.typeId); - /* if (this.$params.tags) - this.tags = JSON.parse(this.$params.tags); */ + if (this.$params.tagGroups) + this.tagGroups = JSON.parse(this.$params.tagGroups); }); } @@ -288,23 +288,28 @@ class Controller extends Section { if (this.typeId) params.typeId = this.typeId; - params.tagGrops = undefined; - if (this.tagGrops.length) { - const tagGrops = []; - for (let tag of this.tagGrops) { - const tagParam = {value: tag.value}; + params.tagGroups = undefined; + if (this.tagGroups && this.tagGroups.length) { + const tagGroups = []; + for (let tagGroup of this.tagGroups) { + const tagParam = {values: []}; - if (tag.tagSelection) { - tagParam.tagFk = tag.tagFk; + for (let tagValue of tagGroup.values) + tagParam.values.push({value: tagValue.value}); + + if (tagGroup.tagFk) + tagParam.tagFk = tagGroup.tagFk; + + if (tagGroup.tagSelection) { tagParam.tagSelection = { - name: tag.tagSelection.name + name: tagGroup.tagSelection.name }; } - tags.push(tagParam); + tagGroups.push(tagParam); } - params.tags = JSON.stringify(tags); + params.tagGroups = JSON.stringify(tagGroups); } this.$state.go(this.$state.current.name, params); diff --git a/modules/order/front/routes.json b/modules/order/front/routes.json index eec628b89..7ebba32c7 100644 --- a/modules/order/front/routes.json +++ b/modules/order/front/routes.json @@ -41,7 +41,7 @@ "order": "$ctrl.order" } }, { - "url": "/catalog?q&categoryId&typeId&tags", + "url": "/catalog?q&categoryId&typeId&tagGroups", "state": "order.card.catalog", "component": "vn-order-catalog", "description": "Catalog",