prettier fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { cache } from 'react';
|
||||
|
||||
import { getProductCategories } from '@lib/data/categories';
|
||||
import { listProducts, listProductTypes } from '@lib/data/products';
|
||||
import { listProductTypes, listProducts } from '@lib/data/products';
|
||||
import { listRegions } from '@lib/data/regions';
|
||||
|
||||
import { OrderAnalysisCard } from '../../_components/order-analyses-cards';
|
||||
@@ -40,9 +40,9 @@ async function analysesLoader() {
|
||||
);
|
||||
const categoryProducts = category
|
||||
? await listProducts({
|
||||
countryCode,
|
||||
queryParams: { limit: 100, category_id: category.id, order: 'title' },
|
||||
})
|
||||
countryCode,
|
||||
queryParams: { limit: 100, category_id: category.id, order: 'title' },
|
||||
})
|
||||
: null;
|
||||
|
||||
const serviceCategories = productCategories.filter(
|
||||
@@ -52,21 +52,24 @@ async function analysesLoader() {
|
||||
return {
|
||||
analyses:
|
||||
categoryProducts?.response.products
|
||||
.filter(({ status, metadata }) => status === 'published' && !!metadata?.analysisIdOriginal)
|
||||
.map<OrderAnalysisCard>(
|
||||
({ title, description, subtitle, variants }) => {
|
||||
const variant = variants![0]!;
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
subtitle,
|
||||
variant: {
|
||||
id: variant.id,
|
||||
},
|
||||
price: variant.calculated_price?.calculated_amount ?? null,
|
||||
};
|
||||
},
|
||||
) ?? [],
|
||||
.filter(
|
||||
({ status, metadata }) =>
|
||||
status === 'published' && !!metadata?.analysisIdOriginal,
|
||||
)
|
||||
.map<OrderAnalysisCard>(
|
||||
({ title, description, subtitle, variants }) => {
|
||||
const variant = variants![0]!;
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
subtitle,
|
||||
variant: {
|
||||
id: variant.id,
|
||||
},
|
||||
price: variant.calculated_price?.calculated_amount ?? null,
|
||||
};
|
||||
},
|
||||
) ?? [],
|
||||
countryCode,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user