From 34b623deb21eec3eb688b00603d46b3e9397b030 Mon Sep 17 00:00:00 2001 From: yuriassuncx Date: Fri, 1 Nov 2024 15:10:46 -0300 Subject: [PATCH] feat: add new prop and body item to cancel order action --- vtex/actions/orders/cancel.ts | 5 +++-- vtex/utils/client.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vtex/actions/orders/cancel.ts b/vtex/actions/orders/cancel.ts index 6f1982370..78401327b 100644 --- a/vtex/actions/orders/cancel.ts +++ b/vtex/actions/orders/cancel.ts @@ -5,6 +5,7 @@ import { CanceledOrder } from "../../utils/types.ts"; interface Props { orderId: string; reason: string; + requestedByUser: boolean; } async function action( @@ -19,13 +20,13 @@ async function action( return null; } - const { orderId, reason } = props; + const { orderId, reason, requestedByUser } = props; const response = await vcsDeprecated ["POST /api/oms/pvt/orders/:orderId/cancel"]( { orderId }, { - body: { reason }, + body: { reason, requestedByUser }, headers: { cookie, }, diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index f2546079e..9866e4b8f 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -257,6 +257,7 @@ export interface VTEXCommerceStable { response: CanceledOrder; body: { reason: string; + requestedByUser: boolean; }; }; }