Prace na sprave letu
This commit is contained in:
@@ -17,9 +17,7 @@ export const useAircraftsStore = defineStore('Aircrafts', {
|
||||
fetchDetail(id) {
|
||||
return apolloWrapper
|
||||
.query(AIRCRAFT_DETAIL, {id})
|
||||
.then((result) => {
|
||||
return result.data.aircraft;
|
||||
});
|
||||
.then((result) => result.data.aircraft);
|
||||
},
|
||||
create(formData) {
|
||||
delete formData['id'];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {defineStore} from 'pinia'
|
||||
import {apolloWrapper} from "src/graphql/apollo"
|
||||
import {FLIGHTS_LIST} from "src/graphql/queries/flights";
|
||||
import {FLIGHT_DETAIL, FLIGHTS_LIST} from "src/graphql/queries/flights";
|
||||
import {CREATE_FLIGHT} from "src/graphql/mutations/flight";
|
||||
|
||||
export const useFlightsStore = defineStore('Flights', {
|
||||
@@ -24,7 +24,7 @@ export const useFlightsStore = defineStore('Flights', {
|
||||
})
|
||||
},
|
||||
fetchDetail(id) {
|
||||
this.items.push({id: id, takeOffLocation: "LKLT", landingLocation: "LKLT", date: "2023-02-01", aircraft: {id: 1, name: "OK-AUR28"}, flightDurationMinutes: 76})
|
||||
return apolloWrapper.query(FLIGHT_DETAIL, {id}).then(result => result.data.flight);
|
||||
},
|
||||
fetch() {
|
||||
return apolloWrapper
|
||||
|
||||
Reference in New Issue
Block a user