BouquetPicker: log category slugs to help diagnose build filter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b3df81fb25
commit
6f6a941007
@ -65,6 +65,10 @@ export default function BouquetPicker({ product, onClose }: Props) {
|
|||||||
fetch(BASE + '/api/catalog').then((r) => r.ok ? r.json() : { items: [] }),
|
fetch(BASE + '/api/catalog').then((r) => r.ok ? r.json() : { items: [] }),
|
||||||
fetch(BASE + '/colors.json').then((r) => r.ok ? r.json() : []),
|
fetch(BASE + '/colors.json').then((r) => r.ok ? r.json() : []),
|
||||||
]).then(([{ items }, families]: [{ items: CatalogItem[] }, ColorFamily[]]) => {
|
]).then(([{ items }, families]: [{ items: CatalogItem[] }, ColorFamily[]]) => {
|
||||||
|
// Log all unique category slugs so we can verify "build" is present
|
||||||
|
const allSlugs = [...new Set((items as CatalogItem[]).flatMap((i) => i.categories ?? [i.category]))]
|
||||||
|
console.log('[BouquetPicker] category slugs in catalog:', allSlugs.sort())
|
||||||
|
|
||||||
const inBuild = (item: CatalogItem) =>
|
const inBuild = (item: CatalogItem) =>
|
||||||
(item.categories ?? []).includes('build') || item.category === 'build'
|
(item.categories ?? []).includes('build') || item.category === 'build'
|
||||||
|
|
||||||
@ -72,6 +76,7 @@ export default function BouquetPicker({ product, onClose }: Props) {
|
|||||||
// showColors items (e.g. the 11" latex) get the color picker treatment
|
// showColors items (e.g. the 11" latex) get the color picker treatment
|
||||||
const mylars = items.filter((i) => inBuild(i) && !i.showColors)
|
const mylars = items.filter((i) => inBuild(i) && !i.showColors)
|
||||||
const latex = items.filter((i) => inBuild(i) && i.showColors)
|
const latex = items.filter((i) => inBuild(i) && i.showColors)
|
||||||
|
console.log(`[BouquetPicker] found ${mylars.length} mylar items, ${latex.length} latex items in "build" category`)
|
||||||
|
|
||||||
setBuildItems([...mylars, ...latex])
|
setBuildItems([...mylars, ...latex])
|
||||||
setColorFamilies(families)
|
setColorFamilies(families)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user