We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 127cee2 commit c701a59Copy full SHA for c701a59
src/repositories/cart.ts
@@ -21,6 +21,7 @@ import type {
21
Price,
22
Product,
23
ProductPagedQueryResponse,
24
+ CartRemoveDiscountCodeAction,
25
ProductVariant,
26
} from '@commercetools/platform-sdk'
27
import { v4 as uuidv4 } from 'uuid'
@@ -415,6 +416,15 @@ export class CartRepository extends AbstractResourceRepository<'cart'> {
415
416
custom: custom,
417
}
418
},
419
+ removeDiscountCode: (
420
+ context: RepositoryContext,
421
+ resource: Writable<Cart>,
422
+ { discountCode }: CartRemoveDiscountCodeAction
423
+ ) => {
424
+ resource.discountCodes = resource.discountCodes.filter(
425
+ (code) => code.discountCode.id !== discountCode.id
426
+ )
427
+ },
428
429
draftLineItemtoLineItem = (
430
projectKey: string,
0 commit comments