Merge branch 'master' of kvacek.cz:poletani.cz/app into planovac
This commit is contained in:
@@ -8,7 +8,11 @@ import {pluralize} from "src/composables/utils";
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
eventId: {
|
eventId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: false
|
||||||
|
},
|
||||||
|
eventUrlSlug: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
onlyPublic: {
|
onlyPublic: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -22,6 +26,7 @@ const totalFlights = ref(0);
|
|||||||
|
|
||||||
useEventsStore().fetchFlightsTracks({
|
useEventsStore().fetchFlightsTracks({
|
||||||
eventId: props.eventId,
|
eventId: props.eventId,
|
||||||
|
eventUrlSlug: props.eventUrlSlug,
|
||||||
onlyPublic: props.onlyPublic
|
onlyPublic: props.onlyPublic
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
if (!data.flights) return;
|
if (!data.flights) return;
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ ${FRAGMENT_EVENT_LIST_INFO}
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const EVENTS_FLIGHTS_TRACKS = gql`
|
export const EVENTS_FLIGHTS_TRACKS = gql`
|
||||||
query eventsFlightsTracks($eventId: Int!, $onlyPublic: Boolean) {
|
query eventsFlightsTracks($eventId: Int, $eventUrlSlug: String, $onlyPublic: Boolean) {
|
||||||
event(id: $eventId) {
|
event(id: $eventId, urlSlug: $eventUrlSlug, public: $onlyPublic) {
|
||||||
flights(onlyPublic: $onlyPublic) {
|
flights(onlyPublic: $onlyPublic) {
|
||||||
durationMinCalculated
|
durationMinCalculated
|
||||||
gpxTrack {
|
gpxTrack {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
|
|||||||
<article class="q-my-lg" v-html="event.description"/>
|
<article class="q-my-lg" v-html="event.description"/>
|
||||||
|
|
||||||
<q-no-ssr>
|
<q-no-ssr>
|
||||||
<EventFlightsMap :event-id="event.id" :only-public="true"/>
|
<EventFlightsMap :event-url-slug="event.urlSlug" :only-public="true"/>
|
||||||
</q-no-ssr>
|
</q-no-ssr>
|
||||||
|
|
||||||
<h3>Lety</h3>
|
<h3>Lety</h3>
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ export const useEventsStore = defineStore('Events', () => {
|
|||||||
}).then(item => event.value = item);
|
}).then(item => event.value = item);
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchFlightsTracks = ({eventId, onlyPublic}) => {
|
const fetchFlightsTracks = ({eventId, eventUrlSlug, onlyPublic}) => {
|
||||||
return query({
|
return query({
|
||||||
query: EVENTS_FLIGHTS_TRACKS,
|
query: EVENTS_FLIGHTS_TRACKS,
|
||||||
variables: {eventId, onlyPublic}
|
variables: {eventId, onlyPublic, eventUrlSlug}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user