Merge branch 'master' of kvacek.cz:poletani.cz/app into planovac

This commit is contained in:
Michal Kváček
2024-04-02 06:13:48 +02:00
4 changed files with 11 additions and 6 deletions
+6 -1
View File
@@ -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;
+2 -2
View File
@@ -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 {
@@ -59,7 +59,7 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
<article class="q-my-lg" v-html="event.description"/>
<q-no-ssr>
<EventFlightsMap :event-id="event.id" :only-public="true"/>
<EventFlightsMap :event-url-slug="event.urlSlug" :only-public="true"/>
</q-no-ssr>
<h3>Lety</h3>
+2 -2
View File
@@ -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}
})
}