fix(coupons): remove duplicate business cols from coupons in PromoterDashboard and CouponsView
This commit is contained in:
@ -24,7 +24,7 @@ onMounted(() => {
|
||||
const filteredCoupons = computed(() => {
|
||||
return couponStore.coupons.filter(c => {
|
||||
const matchesSearch = c.title.toLowerCase().includes(searchQuery.value.toLowerCase()) ||
|
||||
c.business_name?.toLowerCase().includes(searchQuery.value.toLowerCase())
|
||||
c.business?.name?.toLowerCase().includes(searchQuery.value.toLowerCase())
|
||||
const matchesCategory = selectedCategory.value === 'Todas' || c.category === selectedCategory.value
|
||||
return matchesSearch && matchesCategory
|
||||
})
|
||||
@ -43,7 +43,7 @@ function openCoupon(coupon: Coupon) {
|
||||
analyticsService.logEvent({
|
||||
event_name: 'promo_view',
|
||||
item_id: coupon.title,
|
||||
properties: { coupon_id: coupon.id, business: coupon.business_name }
|
||||
properties: { coupon_id: coupon.id, business: coupon.business?.name }
|
||||
})
|
||||
}
|
||||
|
||||
@ -51,13 +51,13 @@ function handleDirections() {
|
||||
if (!selectedCoupon.value) return
|
||||
analyticsService.logEvent({
|
||||
event_name: 'promo_click',
|
||||
item_id: 'directions_' + selectedCoupon.value.business_name,
|
||||
item_id: 'directions_' + selectedCoupon.value.business?.name,
|
||||
properties: {
|
||||
coupon_id: selectedCoupon.value.id,
|
||||
action: 'get_directions'
|
||||
}
|
||||
})
|
||||
window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(selectedCoupon.value.business_address || selectedCoupon.value.business_name || '')}`, '_blank')
|
||||
window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(selectedCoupon.value.business?.address || selectedCoupon.value.business?.name || '')}`, '_blank')
|
||||
}
|
||||
|
||||
function getCategoryIcon(category?: string | null) {
|
||||
@ -142,7 +142,7 @@ function getCategoryIcon(category?: string | null) {
|
||||
</div>
|
||||
|
||||
<div class="offer-content">
|
||||
<h3 class="offer-title">{{ coupon.business_name || 'Restaurante' }}</h3>
|
||||
<h3 class="offer-title">{{ coupon.business?.name || 'Restaurante' }}</h3>
|
||||
<p class="offer-benefit">{{ coupon.title }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -186,7 +186,7 @@ function getCategoryIcon(category?: string | null) {
|
||||
</div>
|
||||
|
||||
<div class="modal-info-section">
|
||||
<h2 class="modal-business-title">{{ selectedCoupon.business_name }}</h2>
|
||||
<h2 class="modal-business-title">{{ selectedCoupon.business?.name }}</h2>
|
||||
|
||||
<div class="benefit-highlight-box">
|
||||
<span class="material-icons icon-label">local_offer</span>
|
||||
|
||||
Reference in New Issue
Block a user