Skip to content

Commit

Permalink
feat: add new prop and body item to cancel order action
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx committed Nov 1, 2024
1 parent 4d350a2 commit 34b623d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vtex/actions/orders/cancel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CanceledOrder } from "../../utils/types.ts";
interface Props {
orderId: string;
reason: string;
requestedByUser: boolean;
}

async function action(
Expand All @@ -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,
},
Expand Down
1 change: 1 addition & 0 deletions vtex/utils/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export interface VTEXCommerceStable {
response: CanceledOrder;
body: {
reason: string;
requestedByUser: boolean;
};
};
}
Expand Down

0 comments on commit 34b623d

Please sign in to comment.