Upravy UI, refaktoring, davkove upravy a mazani fotek

This commit is contained in:
Michal Kváček
2023-08-28 22:02:24 +02:00
parent dcc3230cbe
commit dd248d4432
53 changed files with 636 additions and 357 deletions
+7 -9
View File
@@ -4,18 +4,20 @@ import {createUploadLink} from 'apollo-upload-client';
import {onError} from "@apollo/client/link/error";
import {useUserStore} from "stores/User";
import {useAppStore} from "stores/App";
import {Notify} from "quasar";
import {errorObject, warningObject} from "src/composables/dialog";
const uploadLink = createUploadLink({
uri: process.env.API_URL+'/graphql',
uri: process.env.API_URL + '/graphql',
})
const handleRefreshToken = (forward, operation) => {
return fromPromise(
useUserStore().refreshAccessToken()
.catch((error) => {
console.log("neumim refresh");
// window.location = "/login";
Notify.create(warningObject("Tvoje přihlášení vypřešlo. Přihlaš se prosím znovu."));
window.location = "/login";
})
)
.filter((value) => Boolean(value))
@@ -40,17 +42,14 @@ const errorLink = onError(
}
if (graphQLErrors) {
const messages = [];
for (const error of graphQLErrors) {
if (error.message === "Not found") {
useAppStore().appStatus = 404;
} else if (error.message.includes("401") || error.message.includes("Not authorized")) {
return handleRefreshToken(forward, operation);
} else {
messages.push(error.message);
Notify.create(errorObject("API error: " + error.message));
}
// TODO: zaridit zobrazeni erroru z messages
}
}
});
@@ -81,8 +80,7 @@ export const apolloWrapper = {
})
.then((response) => response)
.catch(err => {
console.log(err.message);
// console.error("Error during query: ", err)
console.error("Error during query: ", err)
return err;
})
},
-1
View File
@@ -61,7 +61,6 @@ fragment flightFullInfo on Flight {
...weatherFullInfo
}
aircraft {
...aircraftFullInfo
}
+4 -1
View File
@@ -9,7 +9,10 @@ export const FRAGMENT_PHOTO_FULL_INFO = gql`
name
description
flightId
pointOfInterestId
pointOfInterest {
id
name
}
isFlightCover
gpsLatitude
gpsLongitude