fix(favorites): adjust favorite button visibility and functionality
- removed favorite button from Discover cards - added call button for taxis in Favorites view - added favorite button in Shuttle details - added Shuttles category in Favorites view
This commit is contained in:
@ -5,7 +5,7 @@ import { supabase } from '@/supabase'
|
||||
export interface Favorite {
|
||||
id: string
|
||||
user_id: string
|
||||
item_type: 'coupon' | 'business' | 'taxi' | 'route' | 'stop'
|
||||
item_type: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle'
|
||||
item_id: string
|
||||
item_name?: string
|
||||
item_image?: string
|
||||
@ -21,6 +21,7 @@ export const useFavoritesStore = defineStore('favorites', () => {
|
||||
const taxis = computed(() => favorites.value.filter(f => f.item_type === 'taxi'))
|
||||
const routes = computed(() => favorites.value.filter(f => f.item_type === 'route'))
|
||||
const stops = computed(() => favorites.value.filter(f => f.item_type === 'stop'))
|
||||
const shuttles = computed(() => favorites.value.filter(f => f.item_type === 'shuttle'))
|
||||
|
||||
async function loadFavorites() {
|
||||
isLoading.value = true
|
||||
@ -50,7 +51,7 @@ export const useFavoritesStore = defineStore('favorites', () => {
|
||||
}
|
||||
|
||||
async function addFavorite(
|
||||
itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop',
|
||||
itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle',
|
||||
itemId: string,
|
||||
itemName?: string,
|
||||
itemImage?: string
|
||||
@ -97,7 +98,7 @@ export const useFavoritesStore = defineStore('favorites', () => {
|
||||
}
|
||||
|
||||
async function toggleFavorite(
|
||||
itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop',
|
||||
itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle',
|
||||
itemId: string,
|
||||
itemName?: string,
|
||||
itemImage?: string
|
||||
@ -121,7 +122,7 @@ export const useFavoritesStore = defineStore('favorites', () => {
|
||||
}
|
||||
|
||||
return {
|
||||
favorites, isLoading, coupons, businesses, taxis, routes, stops,
|
||||
favorites, isLoading, coupons, businesses, taxis, routes, stops, shuttles,
|
||||
loadFavorites, addFavorite, removeFavorite, toggleFavorite, isFavorite
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user