Skip to content

Commit

Permalink
fix: add promotion code encoding to the REST call for promotion code …
Browse files Browse the repository at this point in the history
…removal (#1428)
  • Loading branch information
SGrueber authored May 9, 2023
1 parent 2bf9828 commit db1860d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/core/services/basket/basket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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<string> {
return this.currentBasketEndpoint().delete<string>(`promotioncodes/${codeStr}`, {
return this.currentBasketEndpoint().delete<string>(`promotioncodes/${encodeResourceID(codeStr)}`, {
headers: this.basketHeaders,
});
}
Expand Down

0 comments on commit db1860d

Please sign in to comment.