chore: complete cart part 2 (#7227)

This commit is contained in:
Carlos R. L. Rodrigues
2024-05-05 10:35:09 -03:00
committed by GitHub
parent c32a31e139
commit aba194de9a
24 changed files with 344 additions and 321 deletions
@@ -7,7 +7,7 @@ export const POST = async (
req: MedusaRequest<StoreCompleteCartType>,
res: MedusaResponse
) => {
const { idempotency_key: idempotencyKey } = req.validatedBody
const cart_id = req.params.id
// If the idempotencyKey is present:
// - is workflow is running?
@@ -17,6 +17,9 @@ export const POST = async (
const { errors, result } = await completeCartWorkflow(req.scope).run({
input: { id: req.params.id },
context: {
transactionId: cart_id,
},
throwOnError: false,
})
@@ -14,7 +14,6 @@ export const GET = async (req: MedusaRequest, res: MedusaResponse) => {
select: [
"id",
"sales_channel_id",
"subtotal",
"currency_code",
"shipping_address.city",
"shipping_address.country_code",