Skip to content
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 @@ -4,12 +4,13 @@

import { headers } from 'next/headers';
import { Header, MetricsWrapper } from '@fxa/payments/ui';
import { fetchCMSData, getCartAction } from '@fxa/payments/ui/actions';
import { fetchCMSData, getCartOrRedirectAction } from '@fxa/payments/ui/actions';
import {
getApp,
CheckoutParams,
SignedIn,
SubscriptionTitle,
SupportedPages,
TermsAndPrivacy,
UpgradePurchaseDetails,
} from '@fxa/payments/ui/server';
Expand All @@ -32,7 +33,12 @@ export default async function UpgradeLayout({
const acceptLanguage = (await headers()).get('accept-language');
const l10n = getApp().getL10n(acceptLanguage, locale);

const cartDataPromise = getCartAction(resolvedParams.cartId);
const currentPathname = `/${resolvedParams.locale}/${resolvedParams.offeringId}/${resolvedParams.interval}/upgrade/${resolvedParams.cartId}/start`;
const cartDataPromise = getCartOrRedirectAction(
resolvedParams.cartId,
SupportedPages.START,
currentPathname
);
const cmsDataPromise = fetchCMSData(resolvedParams.offeringId, locale);
const sessionPromise = auth();
const [cms, cart, session] = await Promise.all([
Expand Down