chore: migrate AdminShuttles and old API endpoints from Axios/Render to Supabase client, remove Axios
This commit is contained in:
@ -2,11 +2,9 @@
|
||||
import { onMounted, ref, computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useCouponStore } from '@/stores/coupon'
|
||||
import { SUPABASE_URL } from '@/supabase'
|
||||
import type { Coupon } from '@/types'
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue'
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
|
||||
import { getImageUrl as utilGetImageUrl } from '@/utils/imageUrl'
|
||||
|
||||
const { t } = useI18n()
|
||||
const couponStore = useCouponStore()
|
||||
@ -33,9 +31,7 @@ const filteredCoupons = computed(() => {
|
||||
})
|
||||
|
||||
function getImageUrl(path: string | null | undefined) {
|
||||
if (!path) return '/default-coupon.png'
|
||||
if (path.startsWith('http')) return path
|
||||
return `${API_URL}${path.startsWith('/') ? '' : '/'}${path}`
|
||||
return utilGetImageUrl(path, 'coupon')
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user