chore: migrate AdminShuttles and old API endpoints from Axios/Render to Supabase client, remove Axios
This commit is contained in:
@ -3,9 +3,7 @@ import { ref, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useFavoritesStore } from '@/stores/favorites'
|
||||
import { SUPABASE_URL } from '@/supabase'
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
|
||||
import { getImageUrl as utilGetImageUrl } from '@/utils/imageUrl'
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
@ -26,9 +24,7 @@ onMounted(async () => {
|
||||
})
|
||||
|
||||
function getImageUrl(path?: string) {
|
||||
if (!path) return `https://ui-avatars.com/api/?name=Favorito&background=fee715&color=101820&bold=true`
|
||||
if (path.startsWith('http')) return path
|
||||
return `${API_URL}${path.startsWith('/') ? '' : '/'}${path}`
|
||||
return utilGetImageUrl(path, 'business')
|
||||
}
|
||||
|
||||
async function removeFavorite(event: Event, itemType: string, itemId: string) {
|
||||
|
||||
Reference in New Issue
Block a user