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(extension): CHECKOUT-000 Pass consignment includes to reload checkout command #1785

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ export function createReloadCheckoutHandler({
return {
commandType: ExtensionCommandType.ReloadCheckout,
handler: () => {
void checkoutService.loadCheckout(checkoutService.getState().data.getCheckout()?.id);
void checkoutService.loadCheckout(checkoutService.getState().data.getCheckout()?.id, {
params: {
// eslint-disable-next-line
include: ['consignments.availableShippingOptions'] as any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
include: ['consignments.availableShippingOptions'] as any,
include: [CheckoutIncludes.AvailableShippingOptions],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going by this https://github.com/bigcommerce/checkout-js/blob/master/packages/core/src/app/checkout/Checkout.tsx#L203 but just tried to use the enum and seems to work fine. Seems like we have fixed the enum export issue overtime 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this enum usage throws an undefined error where CheckoutIncludes is not defined. Might need to investigate it later.

},
});
},
};
}