Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
plaskevich committed May 13, 2019
1 parent 6aa50b0 commit 05a2567
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-underscore-dangle': ['error', { 'allow': ['__typename'] }],
'max-len': [
'error', { code: 120 },
],
Expand Down
1 change: 0 additions & 1 deletion src/components/common/AddDiscountCodeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export default {
discountCode {
id
code
name(locale: $locale)
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/common/DiscountCodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{{ discountInfo.discountCode.code }}
</div>
<div class="col-sm-3">{{ discountInfo.discountCode.name }}</div>
<RemoveDiscountCodeForm v-if="cartLike.__typename == 'Cart'"
<RemoveDiscountCodeForm v-if="isCart"
:codeId='discountInfo.discountCode.id'/>
</div>
</div>
Expand All @@ -35,6 +35,12 @@ export default {
},
},
computed: {
isCart() {
return this.cartLike.__typename === 'Cart';
},
},
};
</script>

Expand Down
7 changes: 1 addition & 6 deletions src/components/common/RemoveDiscountCodeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,14 @@ export default {
apollo: {
me: {
query: gql`
query me($locale: Locale!){
query me {
me {
activeCart {
id
version
}
}
}`,
variables() {
return {
locale: this.$i18n.locale,
};
},
},
},
};
Expand Down

0 comments on commit 05a2567

Please sign in to comment.