feat(core-flows, medusa): add shipping methods to cart API (#7150)

* feat(core-flows, medusa): add shipping methods to cart API

* chore: change id to option_id

* chore: use list listShippingOptionsForContext instead of validateShippingOption

* chore: remove comment

* chore: add refresh shipping methods step

* chore: set cart step

* chore: update all workflows to refresh shipping methods

* chore: add tests + cleanup
This commit is contained in:
Riqwan Thamir
2024-04-29 09:25:23 +02:00
committed by GitHub
parent 4b57c5d286
commit d2393f004e
19 changed files with 688 additions and 80 deletions

View File

@@ -1,9 +1,9 @@
type ArrayDifferenceElement = string | number
export function arrayDifference(
mainArray: ArrayDifferenceElement[],
differingArray: ArrayDifferenceElement[]
): ArrayDifferenceElement[] {
export function arrayDifference<TElement = ArrayDifferenceElement>(
mainArray: TElement[],
differingArray: TElement[]
): TElement[] {
const mainArraySet = new Set(mainArray)
const differingArraySet = new Set(differingArray)