refactor time slots

This commit is contained in:
Danel Kungla
2025-09-26 17:20:50 +03:00
parent c99beea46a
commit b674640bd8
5 changed files with 173 additions and 119 deletions

View File

@@ -31,8 +31,11 @@ const env = () =>
.min(1),
})
.parse({
medusaBackendPublicUrl: process.env.MEDUSA_BACKEND_PUBLIC_URL!,
siteUrl: process.env.NEXT_PUBLIC_SITE_URL!,
// Use for local testing
medusaBackendPublicUrl: 'http://webhook.site:3000',
siteUrl: 'http://webhook.site:3000',
// medusaBackendPublicUrl: process.env.MEDUSA_BACKEND_PUBLIC_URL!,
// siteUrl: process.env.NEXT_PUBLIC_SITE_URL!,
});
export async function handleAddToCart({
@@ -42,6 +45,10 @@ export async function handleAddToCart({
selectedVariant: Pick<StoreProductVariant, 'id'>;
countryCode: string;
}) {
try {
} catch (e) {
console.error('medusa card error: ', e);
}
const { account } = await loadCurrentUserAccount();
if (!account) {
throw new Error('Account not found');