Added Notifications
This commit is contained in:
@@ -3,13 +3,15 @@ import {onMounted, ref} from "vue";
|
||||
import {Flight} from "@/Types/types";
|
||||
import axios from "axios";
|
||||
|
||||
export function useFlights(url: string) {
|
||||
export function useFlights(url: string, departedOnly: boolean = false) {
|
||||
const flights = ref<Flight[]>([])
|
||||
const flightsLoading = ref(true)
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await axios.get(url)
|
||||
const response = await axios.get(url, {
|
||||
params: departedOnly ? { departed_only: true } : {}
|
||||
})
|
||||
flights.value = response.data
|
||||
} finally {
|
||||
flightsLoading.value = false
|
||||
|
||||
Reference in New Issue
Block a user