sheets
This commit is contained in:
@@ -191,7 +191,12 @@ async function loadProductsFromExcelAndMdx(locale: 'en' | 'de'): Promise<Product
|
||||
locale,
|
||||
categories: (mdx?.categories || []).map(name => ({ name })),
|
||||
attributes: [],
|
||||
voltageType: data.voltageType,
|
||||
voltageType: (() => {
|
||||
const cats = (mdx?.categories || []).map(c => String(c));
|
||||
const isMV = cats.some(c => /medium[-\s]?voltage|mittelspannung/i.test(c));
|
||||
if (isMV && data.voltageType === 'high-voltage') return 'medium-voltage';
|
||||
return data.voltageType;
|
||||
})(),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user