Jiny pristup k vytvareni letu, polofunkcni editace letu
This commit is contained in:
@@ -8,20 +8,18 @@ fragment flightFullInfo on Flight {
|
||||
takeoffDatetime
|
||||
landingDatetime
|
||||
durationMinCalculated
|
||||
|
||||
|
||||
solo
|
||||
|
||||
takeoffAirport {
|
||||
id
|
||||
name
|
||||
icaoCode
|
||||
}
|
||||
|
||||
landingAirport {
|
||||
id
|
||||
name
|
||||
icaoCode
|
||||
}
|
||||
|
||||
|
||||
aircraft {
|
||||
id
|
||||
name
|
||||
@@ -30,6 +28,14 @@ fragment flightFullInfo on Flight {
|
||||
}
|
||||
`;
|
||||
|
||||
export const FRAGMENT_FLIGHT_EDIT_IDS = gql`
|
||||
fragment flightEditIds on Flight {
|
||||
landingAirportId
|
||||
takeoffAirportId
|
||||
aircraftId
|
||||
copilotId
|
||||
}
|
||||
`;
|
||||
|
||||
// export const FRAGMENT_LOCATION = gql`
|
||||
// fragment airportInfo on Airport {
|
||||
|
||||
@@ -10,3 +10,13 @@ mutation createFlight($input: CreateFlightInput!) {
|
||||
|
||||
${FRAGMENT_FLIGHT_FULL_INFO}
|
||||
`
|
||||
|
||||
export const EDIT_FLIGHT = gql`
|
||||
mutation editFlight($id: Int!, $input: EditFlightInput!) {
|
||||
editFlight(id: $id, input: $input) {
|
||||
...flightFullInfo
|
||||
}
|
||||
}
|
||||
|
||||
${FRAGMENT_FLIGHT_FULL_INFO}
|
||||
`;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import gql from "graphql-tag";
|
||||
import {FRAGMENT_FLIGHT_FULL_INFO} from "src/graphql/fragments/flight";
|
||||
import {FRAGMENT_FLIGHT_EDIT_IDS, FRAGMENT_FLIGHT_FULL_INFO} from "src/graphql/fragments/flight";
|
||||
|
||||
export const FLIGHTS_LIST = gql`
|
||||
query FlightsList {
|
||||
@@ -14,9 +14,11 @@ export const FLIGHT_DETAIL = gql`
|
||||
query FlightDetail($id: Int!) {
|
||||
flight(id: $id) {
|
||||
...flightFullInfo
|
||||
...flightEditIds
|
||||
}
|
||||
}
|
||||
|
||||
${FRAGMENT_FLIGHT_FULL_INFO}
|
||||
${FRAGMENT_FLIGHT_EDIT_IDS}
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user