-
-
+
Tento pilot zatím nepublikoval žádný let.
@@ -54,23 +44,10 @@ const flights = storeToRefs(useFlightsStore()).items;
/>
-
-
-
-
-
-
-
{{ pilot.name }}
-
- Registrován: {{ formatDatetime(pilot.createdAt, FORMAT_DATE) }}
-
-
+
diff --git a/src/pages/public/RegisterPage.vue b/src/pages/public/RegisterPage.vue
index 2831ea7..2419d84 100644
--- a/src/pages/public/RegisterPage.vue
+++ b/src/pages/public/RegisterPage.vue
@@ -46,47 +46,52 @@ const rules = {
-
-
-
- Registrace
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Zpět na login
-
-
-
+
+
+
+ Registrace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Zpět na login
+
+
+
+
+
diff --git a/src/router/routes.js b/src/router/routes.js
index b050e48..c1a53c1 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -4,11 +4,13 @@ const routes = [
{path: '/login', name: "login", component: () => import('pages/public/LoginPage.vue'), meta: {layout: PlainLayout}},
{path: '/register', name: "registration", component: () => import('pages/public/RegisterPage.vue'), meta: {layout: PlainLayout}},
{path: '/forgotten-password', name: "forgottenPassword", component: () => import('pages/public/RegisterPage.vue'), meta: {layout: PlainLayout}},
+
+ {path: '', name: "homepage", component: () => import('pages/public/IndexPage.vue'), meta: {layout: PlainLayout}},
+
{
path: '/',
component: () => import('layouts/PublicLayout.vue'),
children: [
- {path: '', name: "homepage", component: () => import('pages/public/IndexPage.vue')},
{path: 'about', name: "about", component: () => import('pages/public/AboutPage.vue')},
{path: ':username', name: "publicProfileDetail", component: () => import('pages/public/PilotProfilePage.vue')},
{path: ':username/:id', name: "publicFlightDetail", component: () => import('pages/public/FlightDetailPage.vue')},
@@ -22,22 +24,22 @@ const routes = [
},
children: [
{path: '', name: "profile", component: () => import('pages/profile/ProfilePage.vue')},
- {path: 'my-flights', name: "myFlights", component: () => import('pages/profile/lists/FlightsPage.vue')},
- {path: 'my-flights/add', name: "addFlight", component: () => import('pages/profile/forms/NewFlightPage.vue')},
- {path: 'my-flights/:id', name: "flightDetail", component: () => import('pages/profile/details/FlightDetailPage.vue')},
- {path: 'my-flights/:id/edit/:step?', name: "flightEdit", component: () => import('pages/profile/forms/EditFlightPage.vue')},
- {path: 'poi', name: "poi", component: () => import('pages/profile/lists/PointsOfInterestPage.vue')},
- {path: 'poi/add', name: "addPOI", component: () => import('pages/profile/forms/NewPointOfInterestPage.vue')},
- {path: 'poi/:id', name: "poiDetail", component: () => import('pages/profile/details/PointOfInterestDetailPage.vue')},
- {path: 'poi/:id/edit', name: "poiEdit", component: () => import('pages/profile/forms/EditPointOfInterestPage.vue')},
- {path: 'copilots', name: "copilots", component: () => import('pages/profile/lists/CopilotsPage.vue')},
- {path: 'copilots/add', name: "addCopilot", component: () => import('pages/profile/forms/NewCopilotPage.vue')},
- {path: 'copilots/:id', name: "copilotDetail", component: () => import('pages/profile/details/CopilotDetailPage.vue')},
- {path: 'copilots/:id/edit', name: "copilotEdit", component: () => import('pages/profile/forms/EditCopilotPage.vue')},
- {path: 'aircrafts', name: "aircrafts", component: () => import('pages/profile/lists/AircraftsPage.vue')},
- {path: 'aircrafts/new', name: "addAircraft", component: () => import('pages/profile/forms/NewAircraftsPage.vue')},
- {path: 'aircrafts/:id', name: "aircraftDetail", component: () => import('pages/profile/details/AircraftDetailPage.vue')},
- {path: 'aircrafts/:id/edit', name: "aircraftEdit", component: () => import('pages/profile/forms/EditAircraftPage.vue')},
+ {path: 'my-flights', name: "myFlights", component: () => import('pages/profile/flight/FlightsPage.vue')},
+ {path: 'my-flights/add', name: "addFlight", component: () => import('pages/profile/flight/NewFlightPage.vue')},
+ {path: 'my-flights/:id', name: "flightDetail", component: () => import('pages/profile/flight/FlightDetailPage.vue')},
+ {path: 'my-flights/:id/edit/:step?', name: "flightEdit", component: () => import('pages/profile/flight/EditFlightPage.vue')},
+ {path: 'poi', name: "poi", component: () => import('pages/profile/poi/PointsOfInterestPage.vue')},
+ {path: 'poi/add', name: "addPOI", component: () => import('pages/profile/poi/NewPointOfInterestPage.vue')},
+ {path: 'poi/:id', name: "poiDetail", component: () => import('pages/profile/poi/PointOfInterestDetailPage.vue')},
+ {path: 'poi/:id/edit', name: "poiEdit", component: () => import('pages/profile/poi/EditPointOfInterestPage.vue')},
+ {path: 'copilots', name: "copilots", component: () => import('pages/profile/copilot/CopilotsPage.vue')},
+ {path: 'copilots/add', name: "addCopilot", component: () => import('pages/profile/copilot/NewCopilotPage.vue')},
+ {path: 'copilots/:id', name: "copilotDetail", component: () => import('pages/profile/copilot/CopilotDetailPage.vue')},
+ {path: 'copilots/:id/edit', name: "copilotEdit", component: () => import('pages/profile/copilot/EditCopilotPage.vue')},
+ {path: 'aircrafts', name: "aircrafts", component: () => import('pages/profile/aircraft/AircraftsPage.vue')},
+ {path: 'aircrafts/new', name: "addAircraft", component: () => import('pages/profile/aircraft/NewAircraftsPage.vue')},
+ {path: 'aircrafts/:id', name: "aircraftDetail", component: () => import('pages/profile/aircraft/AircraftDetailPage.vue')},
+ {path: 'aircrafts/:id/edit', name: "aircraftEdit", component: () => import('pages/profile/aircraft/EditAircraftPage.vue')},
]
},
diff --git a/src/stores/Aircrafts.js b/src/stores/Aircrafts.js
index 9346a9b..e432169 100644
--- a/src/stores/Aircrafts.js
+++ b/src/stores/Aircrafts.js
@@ -14,6 +14,7 @@ export const useAircraftsStore = defineStore('Aircrafts', {
actions: {
fetchDetail(id) {
+ console.log(id);
return apolloWrapper
.query(AIRCRAFT_DETAIL, {id})
.then((result) => result.data.aircraft);
diff --git a/src/stores/Flights.js b/src/stores/Flights.js
index c24522d..7468539 100644
--- a/src/stores/Flights.js
+++ b/src/stores/Flights.js
@@ -36,20 +36,23 @@ export const useFlightsStore = defineStore('Flights', {
return flight;
});
},
- fetchDetail(id, username) {
+ fetchDetail(id, username = null) {
if (typeof id !== "number") {
id = parseInt(id);
}
return apolloWrapper.query(FLIGHT_DETAIL, {id, username}).then(result => result.data.flight);
},
- fetch(username) {
+ fetch(username = null) {
return apolloWrapper
.query(FLIGHTS_LIST, {username})
- .then(({data}) => {
+ .then((resp) => {
+ console.log(resp);
+ const data = resp.data;
+
this.items = data.flights;
return data.flights;
- });
+ }).catch(err => console.log(err));
},
delete(id) {
return apolloWrapper.mutate(DELETE_FLIGHT, {id}).then(({data}) => {
diff --git a/src/stores/User.js b/src/stores/User.js
index 0c87f7d..532c985 100644
--- a/src/stores/User.js
+++ b/src/stores/User.js
@@ -72,6 +72,10 @@ export const useUserStore = defineStore('LoggedUser', {
return localStorage.getItem(`accessToken`);
},
+ hasAccessToken() {
+ return !!localStorage.getItem("accessToken");
+ },
+
async refreshAccessToken() {
return api.post("/refresh")
.then(({data}) => {