From db1860daf1bc360c4ed45730219da6e1c54e5138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Silke=20Gr=C3=BCber?= Date: Tue, 9 May 2023 08:40:08 +0200 Subject: [PATCH] fix: add promotion code encoding to the REST call for promotion code removal (#1428) --- src/app/core/services/basket/basket.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/core/services/basket/basket.service.ts b/src/app/core/services/basket/basket.service.ts index 30db67cce5..d65a72894a 100644 --- a/src/app/core/services/basket/basket.service.ts +++ b/src/app/core/services/basket/basket.service.ts @@ -28,6 +28,7 @@ import { ShippingMethod } from 'ish-core/models/shipping-method/shipping-method. import { ApiService, AvailableOptions, unpackEnvelope } from 'ish-core/services/api/api.service'; import { OrderService } from 'ish-core/services/order/order.service'; import { getBasketIdOrCurrent, getCurrentBasket } from 'ish-core/store/customer/basket'; +import { encodeResourceID } from 'ish-core/utils/url-resource-ids'; export type BasketUpdateType = | { invoiceToAddress: string } @@ -396,7 +397,7 @@ export class BasketService { * @param codeStr The code string of the promotion code that should be removed from basket. */ removePromotionCodeFromBasket(codeStr: string): Observable { - return this.currentBasketEndpoint().delete(`promotioncodes/${codeStr}`, { + return this.currentBasketEndpoint().delete(`promotioncodes/${encodeResourceID(codeStr)}`, { headers: this.basketHeaders, }); }