fix(core-flows): refresh payment collection inside updateCartPromotionsWorkflow (patch) (#14274)

* Refresh payment collection after cart promotion update

* Add missing test

* Add changeset

* Update changeset

* Add force_refresh_payment_collection to updateCartPromotionsWorkflow to conditionally refresh payment collection

* Prevent refreshing payment collection multiple times

* Fix test

* Formatting and unused vars

* Force refresh payment collection on dedicated store cart promotion endpoints

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Nicolas Gorga
2025-12-11 10:29:52 +01:00
committed by GitHub
co-authored by Adrien de Peretti Oli Juhl
parent a78f68fa46
commit d565a92f63
2 changed files with 89 additions and 5 deletions
@@ -19,6 +19,7 @@ export const POST = async (
payload.promo_codes.length > 0
? PromotionActions.ADD
: PromotionActions.REPLACE,
force_refresh_payment_collection: true,
},
})
@@ -48,6 +49,7 @@ export const DELETE = async (
promo_codes: payload.promo_codes,
cart_id: req.params.id,
action: PromotionActions.REMOVE,
force_refresh_payment_collection: true,
},
})