Fix: entity type detection in selectProduct, handle offer in add-to-filter
All checks were successful
Build Docker Image / build (push) Successful in 3m47s
All checks were successful
Build Docker Image / build (push) Successful in 3m47s
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user