Fix: entity type detection in selectProduct, handle offer in add-to-filter
All checks were successful
Build Docker Image / build (push) Successful in 3m47s

This commit is contained in:
Ruslan Bakiev
2026-01-26 15:29:17 +07:00
parent c76750a738
commit 1c298951b1
2 changed files with 17 additions and 11 deletions

View File

@@ -399,9 +399,17 @@ const onInfoClose = () => {
const onInfoAddToFilter = () => {
if (!infoId.value || !entity.value) return
const { type, uuid } = infoId.value
// Fallback for name - offer entities might use productName
const name = entity.value.name || entity.value.productName || uuid.slice(0, 8) + '...'
selectItem(type, uuid, name)
// For offers, add the product to filter (not the offer itself)
if (type === 'offer' && entity.value.productUuid) {
const productName = entity.value.productName || entity.value.name || uuid.slice(0, 8) + '...'
selectItem('product', entity.value.productUuid, productName)
} else {
// For hubs and suppliers, add directly
const name = entity.value.name || uuid.slice(0, 8) + '...'
selectItem(type, uuid, name)
}
closeInfo()
clearInfo()
}