MED-197: improve analysis compare page
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { loadCurrentUserAccount } from '@/app/home/(user)/_lib/server/load-user-account';
|
||||
import { MontonioOrderHandlerService } from '@/packages/billing/montonio/src';
|
||||
import { getLogger } from '@/packages/shared/src/logger';
|
||||
import { addToCart, deleteLineItem, retrieveCart } from '@lib/data/cart';
|
||||
import { getCartId } from '@lib/data/cookies';
|
||||
import { StoreCartLineItem, StoreProductVariant } from '@medusajs/types';
|
||||
@@ -44,12 +45,17 @@ export async function handleAddToCart({
|
||||
selectedVariant: Pick<StoreProductVariant, 'id'>;
|
||||
countryCode: string;
|
||||
}) {
|
||||
try {
|
||||
} catch (e) {
|
||||
console.error('medusa card error: ', e);
|
||||
}
|
||||
const logger = await getLogger();
|
||||
const ctx = {
|
||||
countryCode,
|
||||
selectedVariant,
|
||||
};
|
||||
|
||||
logger.info(ctx, 'Adding to cart...');
|
||||
|
||||
const { account } = await loadCurrentUserAccount();
|
||||
if (!account) {
|
||||
logger.error(ctx, 'Account not found');
|
||||
throw new Error('Account not found');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user