chore: migrate AdminShuttles and old API endpoints from Axios/Render to Supabase client, remove Axios

This commit is contained in:
2026-02-26 14:51:03 -05:00
parent 30c3f092d8
commit 35a29fbb0f
9 changed files with 69 additions and 175 deletions

View File

@ -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')
}