Skip to content

Commit

Permalink
fix(price create form): fix form init when coming from category (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 28, 2024
1 parent 30fe0a7 commit 00d4ffa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/views/AddPriceSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,13 @@ export default {
},
mounted() {
if (this.$route.query.code) {
this.setProductCode(this.$route.query.code)
if (this.$route.query.code.startsWith('en')) {
this.productMode = 'category'
this.addPriceSingleForm.category_tag = this.$route.query.code
}
else {
this.setProductCode(this.$route.query.code)
}
}
this.initPriceSingleForm()
},
Expand All @@ -413,7 +419,7 @@ export default {
* init form config (product mode, categories, origins, last locations)
* init form
*/
this.productMode = this.addPriceSingleForm.product_code ? 'barcode' : this.appStore.user.last_product_mode_used
this.productMode = this.productMode ? this.productMode : (this.addPriceSingleForm.product_code ? 'barcode' : this.appStore.user.last_product_mode_used)
utils.getLocaleCategoryTags(this.appStore.getUserLanguage).then((module) => {
this.categoryTags = module.default
})
Expand Down

0 comments on commit 00d4ffa

Please sign in to comment.