Skip to content

Commit e975609

Browse files
mbektimiroveugene-sy
authored andcommitted
Fix gift card delete route (#27)
* Fix gift card delete route * Fix doc string
1 parent e92c3c4 commit e975609

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/api/cart.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ export default class Cart {
171171
}
172172

173173
/**
174-
* @method removeGiftCards(): Promise<FullOrder>
175-
* Removes all gift cards payment methods of the cart.
174+
* @method removeGiftCard(giftCardCode: string): Promise<FullOrder>
175+
* Removes gift card with provided code payment method from the cart.
176176
*/
177-
removeGiftCards() {
178-
return this.api.delete(endpoints.cartPaymentGiftCards).then(normalizeResponse);
177+
removeGiftCard(giftCardCode) {
178+
return this.api.delete(endpoints.cartPaymentGiftCardsWithCode(giftCardCode)).then(normalizeResponse);
179179
}
180180

181181
/**

src/endpoints.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const shippingAddressId = id => `${shippingAddress}/${id}`;
2222
export const cartLineItems = '/v1/my/cart/line-items';
2323
export const cartPaymentCreditCarts = '/v1/my/cart/payment-methods/credit-cards';
2424
export const cartPaymentGiftCards = '/v1/my/cart/payment-methods/gift-cards';
25+
export const cartPaymentGiftCardsWithCode = giftCardCode => `/v1/my/cart/payment-methods/gift-cards/${giftCardCode}`;
2526
export const cartPaymentStoreCredits = '/v1/my/cart/payment-methods/store-credits';
2627
export const cartPaymentCouponCode = '/v1/my/cart/coupon';
2728
export const cartPaymentCouponCodeWithCode = code => `/v1/my/cart/coupon/${code}`;

0 commit comments

Comments
 (0)