MED-197: improve analysis compare page

This commit is contained in:
Danel Kungla
2025-10-07 18:07:59 +03:00
parent 258bd62a7f
commit 57f992a5c3
14 changed files with 218 additions and 18 deletions

View File

@@ -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');
}