Show component selections and support multi product requirements

This commit is contained in:
Matthieu
2026-01-25 11:40:29 +01:00
parent 55739fe50f
commit b27662d2bc
4 changed files with 438 additions and 55 deletions

View File

@@ -56,6 +56,15 @@ export function usePieces () {
piece.productId = productId
}
}
const productIds = Array.isArray(piece.productIds) ? piece.productIds.filter(Boolean) : []
if (productIds.length === 0 && piece.productId) {
piece.productIds = [piece.productId]
} else if (productIds.length > 0) {
piece.productIds = productIds.map((id) => String(id))
if (!piece.productId) {
piece.productId = piece.productIds[0] || null
}
}
const ids = uniqueConstructeurIds(
piece.constructeurIds,
piece.constructeurs,