diff --git a/framework/reactioncommerce/utils/normalize.ts b/framework/reactioncommerce/utils/normalize.ts index 2b015868f..aa2afcec5 100644 --- a/framework/reactioncommerce/utils/normalize.ts +++ b/framework/reactioncommerce/utils/normalize.ts @@ -53,7 +53,7 @@ const normalizeProductOption = ({ id, displayName, values }: ProductOption) => { } } -const normalizeProductVariants = (variants: Maybe[]) => { +const normalizeProductVariants = (variants: CatalogProductVariant[]) => { return variants.map((variant) => { const { _id, options, sku, title, pricing = [], variantId } = variant ?? {} const variantPrice = pricing[0]?.price ?? pricing[0]?.minPrice ?? 0 @@ -79,7 +79,7 @@ const normalizeProductVariants = (variants: Maybe[]) => { } export function groupProductOptionsByAttributeLabel( - options: Maybe[] + options: CatalogProductVariant[] ) { return options.reduce((groupedOptions, currentOption) => { const attributeLabelIndex = groupedOptions.findIndex((option) => { @@ -101,7 +101,7 @@ export function groupProductOptionsByAttributeLabel( groupedOptions = [ ...groupedOptions, normalizeProductOption({ - id: currentOption?.variantId ?? '', + id: currentOption?._id ?? '', displayName: currentOption?.attributeLabel ?? '', values: [currentOption?.optionTitle ?? ''], }), diff --git a/next.config.js b/next.config.js index 9e5858bc5..580869846 100644 --- a/next.config.js +++ b/next.config.js @@ -11,7 +11,7 @@ const isRC = provider === 'reactioncommerce' module.exports = withCommerceConfig({ env: { - NEXTAUTH_URL: process.env.NEXTAUTH_URL, + REACTION_API_DOMAIN: process.env.REACTION_API_DOMAIN, }, commerce, i18n: {