Homepage, verejna cast, vetsi sada uprav a oprav

This commit is contained in:
Michal Kváček
2023-08-21 22:45:58 +02:00
parent 8bc477a611
commit 8c3b8d19dd
54 changed files with 550 additions and 372 deletions
+19 -18
View File
@@ -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(
+1
View File
@@ -8,6 +8,7 @@ fragment aircraftFullInfo on Aircraft {
description
manufacturer
photoUrl
seats
}
`;
+1 -6
View File
@@ -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
}
+4 -4
View File
@@ -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
}
}