MED-103: add booking functionality

This commit is contained in:
Helena
2025-09-17 18:11:13 +03:00
parent 7c92b787ce
commit 22f7fa134b
44 changed files with 1923 additions and 479 deletions

View File

@@ -10,38 +10,36 @@ async function ttoServicesLoader() {
});
const heroCategories = response.product_categories?.filter(
({ parent_category, is_active, metadata }) =>
parent_category?.handle === 'tto-categories' &&
is_active &&
metadata?.isHero,
({ parent_category, metadata }) =>
parent_category?.handle === 'tto-categories' && metadata?.isHero,
);
const ttoCategories = response.product_categories?.filter(
({ parent_category, is_active, metadata }) =>
parent_category?.handle === 'tto-categories' &&
is_active &&
!metadata?.isHero,
({ parent_category, metadata }) =>
parent_category?.handle === 'tto-categories' && !metadata?.isHero,
);
return {
heroCategories:
heroCategories.map<ServiceCategory>(
({ name, handle, metadata, description }) => ({
heroCategories.map<Omit<ServiceCategory, 'countryCode'>>(
({ name, handle, metadata, description, products }) => ({
name,
handle,
color:
typeof metadata?.color === 'string' ? metadata.color : 'primary',
description,
products: products ?? [],
}),
) ?? [],
ttoCategories:
ttoCategories.map<ServiceCategory>(
({ name, handle, metadata, description }) => ({
ttoCategories.map<Omit<ServiceCategory, 'countryCode'>>(
({ name, handle, metadata, description, products }) => ({
name,
handle,
color:
typeof metadata?.color === 'string' ? metadata.color : 'primary',
description,
products: products ?? [],
}),
) ?? [],
};