Skip to content

Commit

Permalink
feat(extension): CHECKOUT-000 Change includes to use enum
Browse files Browse the repository at this point in the history
  • Loading branch information
animesh1987 committed Apr 4, 2024
1 parent 8d7e5b2 commit 14dc812
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExtensionCommandType } from '@bigcommerce/checkout-sdk';
import { CheckoutIncludes, ExtensionCommandType } from '@bigcommerce/checkout-sdk';

import { CommandHandler, HandlerProps } from './CommandHandler';

Expand All @@ -10,8 +10,7 @@ export function createReloadCheckoutHandler({
handler: () => {
void checkoutService.loadCheckout(checkoutService.getState().data.getCheckout()?.id, {
params: {
// eslint-disable-next-line
include: ['consignments.availableShippingOptions'] as any,
include: [CheckoutIncludes.AvailableShippingOptions],
},
});
},
Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/app/checkout/Checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Address,
Cart,
CartChangedError,
CheckoutIncludes,
CheckoutParams,
CheckoutSelectors,
Consignment,
Expand Down Expand Up @@ -198,9 +199,9 @@ class Checkout extends Component<
const [{ data }] = await Promise.all([loadCheckout(checkoutId, {
params: {
include: [
'cart.lineItems.physicalItems.categoryNames',
'cart.lineItems.digitalItems.categoryNames',
] as any, // FIXME: Currently the enum is not exported so it can't be used here.
CheckoutIncludes.PhysicalItemsCategoryNames,
CheckoutIncludes.DigitalItemsCategoryNames,
],
},
}), extensionService.loadExtensions()]);

Expand Down

0 comments on commit 14dc812

Please sign in to comment.