diff --git a/src/components/event/EventFlightsMap.vue b/src/components/event/EventFlightsMap.vue index 4513c12..5732558 100644 --- a/src/components/event/EventFlightsMap.vue +++ b/src/components/event/EventFlightsMap.vue @@ -8,7 +8,11 @@ import {pluralize} from "src/composables/utils"; const props = defineProps({ eventId: { type: Number, - required: true + required: false + }, + eventUrlSlug: { + type: String, + required: false, }, onlyPublic: { type: Boolean, @@ -22,6 +26,7 @@ const totalFlights = ref(0); useEventsStore().fetchFlightsTracks({ eventId: props.eventId, + eventUrlSlug: props.eventUrlSlug, onlyPublic: props.onlyPublic }).then((data) => { if (!data.flights) return; diff --git a/src/graphql/queries/event.js b/src/graphql/queries/event.js index 66f21d0..94cac4a 100644 --- a/src/graphql/queries/event.js +++ b/src/graphql/queries/event.js @@ -21,8 +21,8 @@ ${FRAGMENT_EVENT_LIST_INFO} `; export const EVENTS_FLIGHTS_TRACKS = gql` -query eventsFlightsTracks($eventId: Int!, $onlyPublic: Boolean) { - event(id: $eventId) { +query eventsFlightsTracks($eventId: Int, $eventUrlSlug: String, $onlyPublic: Boolean) { + event(id: $eventId, urlSlug: $eventUrlSlug, public: $onlyPublic) { flights(onlyPublic: $onlyPublic) { durationMinCalculated gpxTrack { diff --git a/src/pages/public/pilotProfile/EventDetailPage.vue b/src/pages/public/pilotProfile/EventDetailPage.vue index 3655c09..3239834 100644 --- a/src/pages/public/pilotProfile/EventDetailPage.vue +++ b/src/pages/public/pilotProfile/EventDetailPage.vue @@ -59,7 +59,7 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
- +

Lety

diff --git a/src/stores/Events.js b/src/stores/Events.js index 4f43840..e0a3656 100644 --- a/src/stores/Events.js +++ b/src/stores/Events.js @@ -27,10 +27,10 @@ export const useEventsStore = defineStore('Events', () => { }).then(item => event.value = item); }; - const fetchFlightsTracks = ({eventId, onlyPublic}) => { + const fetchFlightsTracks = ({eventId, eventUrlSlug, onlyPublic}) => { return query({ query: EVENTS_FLIGHTS_TRACKS, - variables: {eventId, onlyPublic} + variables: {eventId, onlyPublic, eventUrlSlug} }) }