Verejna cast, hezci 404ka, refaktoring
This commit is contained in:
@@ -3,6 +3,7 @@ import {useFlightsStore} from "stores/Flights";
|
||||
import {ref} from "vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {confirmObject} from "src/composables/dialog";
|
||||
import {useAppStore} from "stores/App";
|
||||
|
||||
export const flightName = (flight) => {
|
||||
const date = formatDatetime(flight.takeoffDatetime, FORMAT_DATE);
|
||||
@@ -15,9 +16,9 @@ export const flightName = (flight) => {
|
||||
|
||||
export const loading = ref(true);
|
||||
export const flight = ref(null);
|
||||
export const fetchFlight = (flightId) => {
|
||||
export const fetchFlight = (flightId, username) => {
|
||||
loading.value = true;
|
||||
return useFlightsStore().fetchDetail(parseInt(flightId))
|
||||
return useFlightsStore().fetchDetail(parseInt(flightId), username)
|
||||
.then(respFlight => {
|
||||
flight.value = respFlight;
|
||||
return respFlight;
|
||||
@@ -42,4 +43,3 @@ export const handleDeleteFlight = ($q, flightId, onOkCallback = () => {
|
||||
useFlightsStore().delete(flightId).then(onOkCallback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user