Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new prop and body item to cancel order action #951

Conversation

yuriassuncx
Copy link
Contributor

@yuriassuncx yuriassuncx commented Nov 1, 2024

What is this Contribution About?

  • Interface Update: Added the requestedByUser property to the Props interface.

Reference: https://developers.vtex.com/docs/guides/order-canceling-improvements

  ```typescript
  interface Props {
    orderId: string;
    reason: string;
    requestedByUser: boolean; // New property added
  }
  • Action Function Update: Updated the action function to include the requestedByUser in the request body.

    async function action(props: Props) {
      const { orderId, reason, requestedByUser } = props;
    
      const response = await vcsDeprecated
        ["POST /api/oms/pvt/orders/:orderId/cancel"](
          { orderId },
          {
            body: { reason, requestedByUser }, // New property included
            headers: { cookie },
          }
        );
    }
  • VTEXCommerceStable Interface: Added requestedByUser to the VTEXCommerceStable interface.

    export interface VTEXCommerceStable {
      response: CanceledOrder;
      body: {
        reason: string;
        requestedByUser: boolean; // New property added
      };
    }

Reason

The addition of the requestedByUser property helps track who is requesting the order cancellation, improving user action monitoring.

Copy link
Contributor

github-actions bot commented Nov 1, 2024

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.63.1 update
  • 🎉 for Minor 0.64.0 update
  • 🚀 for Major 1.0.0 update

@marcoferreiradev marcoferreiradev merged commit 7ff7739 into deco-cx:feat/myaccountvtex Nov 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants