Files
FlightsAPI/resources/js/Composables/useFlights.ts
T
2026-06-21 18:52:25 +10:00

12 lines
359 B
TypeScript

import { computed } from 'vue'
import { useApiResource } from '@/Composables/useApiResource'
import type { Flight } from '@/Types/types'
export function useFlights(url: string) {
const { data, loading, error } = useApiResource<Flight[]>(url)
const flights = computed(() => data.value ?? [])
return { flights, flightsLoading: loading, error }
}