translations, remove random empty lines, refactor

This commit is contained in:
Helena
2025-09-19 17:28:45 +03:00
parent c50b75ce9b
commit 961f726520
11 changed files with 166 additions and 115 deletions

View File

@@ -11,6 +11,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { EnrichedCartItem } from '../../app/home/(user)/_components/cart/types';
import { loadCurrentUserAccount } from '../../app/home/(user)/_lib/server/load-user-account';
import { createCartEntriesLog } from './audit/cartEntries';
import { handleDeleteCartItem } from './medusaCart.service';
type Locations = Tables<{ schema: 'medreport' }, 'connected_online_locations'>;
@@ -305,29 +306,21 @@ export async function updateReservationTime(
.throwOnError();
logger.info(`Successfully updated reservation ${reservationData}`);
await supabase
.schema('audit')
.from('cart_entries')
.insert({
operation: 'CHANGE_RESERVATION',
account_id: account.id,
cart_id: cartId,
changed_by: user.id,
comment: `${reservationData}`,
});
await createCartEntriesLog({
operation: 'CHANGE_RESERVATION',
accountId: account.id,
cartId: cartId,
comment: `${reservationData}`,
});
revalidatePath('/home/cart', 'layout');
} catch (e) {
logger.error(`Failed to update reservation ${reservationData}`);
await supabase
.schema('audit')
.from('cart_entries')
.insert({
operation: 'CHANGE_RESERVATION',
account_id: account.id,
cart_id: cartId,
changed_by: user.id,
comment: `${e}`,
});
await createCartEntriesLog({
operation: 'CHANGE_RESERVATION',
accountId: account.id,
cartId: cartId,
comment: `${e}`,
});
throw e;
}
}