Merge pull request #96 from MR-medreport/analysis-xml-fix-1109
small fixes for dev
This commit is contained in:
@@ -14,6 +14,7 @@ export default function OrderBlock({ analysisOrder, itemsAnalysisPackage, itemsO
|
||||
<div className="flex flex-col gap-4">
|
||||
<h4>
|
||||
<Trans i18nKey="analysis-results:orderTitle" values={{ orderNumber: analysisOrder.medusa_order_id }} />
|
||||
{` (${analysisOrder.id})`}
|
||||
</h4>
|
||||
<div className="flex gap-2">
|
||||
<h5>
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function SelectAnalysisPackage({
|
||||
};
|
||||
|
||||
return (
|
||||
<Card key={title}>
|
||||
<Card key={title} className="flex flex-col">
|
||||
<CardHeader className="relative">
|
||||
{description && (
|
||||
<ButtonTooltip
|
||||
@@ -103,7 +103,7 @@ export default function SelectAnalysisPackage({
|
||||
className="max-h-48 w-full opacity-10"
|
||||
/>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-1 text-center">
|
||||
<CardContent className="space-y-2 text-center">
|
||||
<PackageHeader
|
||||
title={title}
|
||||
tagColor="bg-cyan"
|
||||
@@ -113,7 +113,7 @@ export default function SelectAnalysisPackage({
|
||||
/>
|
||||
<CardDescription>{subtitle}</CardDescription>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<CardFooter className="mt-auto">
|
||||
<Button
|
||||
className="w-full text-[10px] sm:text-sm"
|
||||
onClick={handleSelect}
|
||||
|
||||
@@ -206,14 +206,7 @@ class AuthCallbackService {
|
||||
return;
|
||||
}
|
||||
|
||||
// If user already has Medusa account, we're done
|
||||
if (accountData?.medusa_account_id) {
|
||||
console.log('Keycloak user already has Medusa account:', accountData.medusa_account_id);
|
||||
return;
|
||||
}
|
||||
|
||||
const { medusaLoginOrRegister } = await import('../../features/medusa-storefront/src/lib/data/customer');
|
||||
|
||||
const medusaAccountId = await medusaLoginOrRegister({
|
||||
email: user.email,
|
||||
supabaseUserId: user.id,
|
||||
@@ -221,7 +214,8 @@ class AuthCallbackService {
|
||||
lastName: accountData?.last_name ?? '-',
|
||||
});
|
||||
|
||||
// Update the account with the Medusa account ID
|
||||
const currentMedusaAccountId = accountData?.medusa_account_id;
|
||||
if (!currentMedusaAccountId || currentMedusaAccountId !== medusaAccountId) {
|
||||
const { error: updateError } = await this.client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
@@ -235,6 +229,9 @@ class AuthCallbackService {
|
||||
}
|
||||
|
||||
console.log('Successfully set up Medusa account for Keycloak user:', medusaAccountId);
|
||||
} else {
|
||||
console.log('Keycloak user already has Medusa account:', accountData.medusa_account_id);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error setting up Medusa account for Keycloak user:', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user