Homepage, verejna cast, vetsi sada uprav a oprav
This commit is contained in:
+19
-18
@@ -12,25 +12,26 @@ const uploadLink = createUploadLink({
|
||||
})
|
||||
|
||||
const handleRefreshToken = (forward, operation) => {
|
||||
return fromPromise(
|
||||
useUserStore().refreshAccessToken()
|
||||
.catch((error) => {
|
||||
window.location = "/login";
|
||||
})
|
||||
)
|
||||
.filter((value) => Boolean(value))
|
||||
.flatMap((accessToken) => {
|
||||
const oldHeaders = operation.getContext().headers;
|
||||
operation.setContext({
|
||||
headers: {
|
||||
...oldHeaders,
|
||||
authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
});
|
||||
return fromPromise(
|
||||
useUserStore().refreshAccessToken()
|
||||
.catch((error) => {
|
||||
console.log("neumim refresh");
|
||||
// window.location = "/login";
|
||||
})
|
||||
)
|
||||
.filter((value) => Boolean(value))
|
||||
.flatMap((accessToken) => {
|
||||
const oldHeaders = operation.getContext().headers;
|
||||
operation.setContext({
|
||||
headers: {
|
||||
...oldHeaders,
|
||||
authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
});
|
||||
|
||||
// retry the request, returning the new observable
|
||||
return forward(operation);
|
||||
});
|
||||
// retry the request, returning the new observable
|
||||
return forward(operation);
|
||||
});
|
||||
}
|
||||
|
||||
const errorLink = onError(
|
||||
|
||||
@@ -8,6 +8,7 @@ fragment aircraftFullInfo on Aircraft {
|
||||
description
|
||||
manufacturer
|
||||
photoUrl
|
||||
seats
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ fragment flightFullInfo on Flight {
|
||||
...airportInfo
|
||||
}
|
||||
|
||||
copilot {
|
||||
copilots {
|
||||
id
|
||||
name
|
||||
}
|
||||
@@ -91,11 +91,6 @@ fragment flightListInfo on Flight {
|
||||
thumbnailUrl
|
||||
}
|
||||
|
||||
copilot {
|
||||
id
|
||||
name
|
||||
}
|
||||
|
||||
takeoffAirport {
|
||||
...airportInfo
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import gql from "graphql-tag";
|
||||
import {FRAGMENT_FLIGHT_FULL_INFO, FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight";
|
||||
|
||||
export const FLIGHTS_LIST = gql`
|
||||
query FlightsList {
|
||||
flights {
|
||||
query FlightsList($username: String) {
|
||||
flights(username: $username) {
|
||||
...flightListInfo
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ ${FRAGMENT_FLIGHT_LIST_INFO}
|
||||
`;
|
||||
|
||||
export const FLIGHT_DETAIL = gql`
|
||||
query FlightDetail($id: Int!) {
|
||||
flight(id: $id) {
|
||||
query FlightDetail($id: Int!, $username: String) {
|
||||
flight(id: $id, username: $username) {
|
||||
...flightFullInfo
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user