Skip to content

Commit

Permalink
fix: skipping second addToBasket mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
tiarascoleman committed Aug 7, 2023
1 parent edebe08 commit cbd7cf6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:custom-loan-details="true"
:custom-checkout-button-text="getCheckoutBtnText(loan)"
:checkout-route="checkoutRoute"
:use-emitted-add-to-basket="true"
@show-loan-details="showLoanDetails(loans[index])"
@add-to-basket="addToBasket"
@custom-checkout-button-action="removeLoanFromBasket(loan)"
Expand Down
1 change: 1 addition & 0 deletions src/components/CorporateCampaign/CampaignLoanRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
:checkout-route="checkoutRoute"
:custom-loan-details="true"
:custom-checkout-button-text="getCheckoutBtnText(loan)"
:use-emitted-add-to-basket="true"
@show-loan-details="showLoanDetails(loans[index])"
@add-to-basket="addToBasket"
@custom-checkout-button-action="removeLoanFromBasket(loan)"
Expand Down
10 changes: 9 additions & 1 deletion src/components/LoanCards/KivaClassicBasicLoanCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ export default {
enableFiveDollarsNotes: {
type: Boolean,
default: false
},
useEmittedAddToBasket: {
type: Boolean,
default: false
}
},
inject: ['apollo', 'cookieStore'],
Expand Down Expand Up @@ -537,7 +541,11 @@ export default {
if (this.loan) this.isLoading = false;
this.basketItems = result.data?.shop?.basket?.items?.values || null;
},
addToBasket() {
addToBasket(payload) {
if (this.useEmittedAddToBasket) {
this.$emit('add-to-basket', payload);
return true;
}
this.isAdding = true;
setLendAmount({
amount: this.lendAmount,
Expand Down

0 comments on commit cbd7cf6

Please sign in to comment.