Ne uplne otestovany prepis storu
This commit is contained in:
@@ -1,25 +1,23 @@
|
||||
<script setup>
|
||||
import {onMounted, watch} from "vue";
|
||||
import {event, fetchEvent, loading} from "src/composables/objects/event";
|
||||
import {useRoute} from "vue-router";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightDetailSkeleton from "components/flights/FlightDetailSkeleton.vue";
|
||||
import {fetchUser, loading as pilotLoading, user as pilot} from "src/composables/objects/user";
|
||||
import PublicProfileSkeleton from "components/profile/PublicProfileSkeleton.vue";
|
||||
import PilotProfileCard from "components/profile/PilotProfileCard.vue";
|
||||
import EventDetailSkeleton from "components/event/EventDetailSkeleton.vue";
|
||||
import {FORMAT_DATE, formatDatetime} from "src/composables/datetimeUtils";
|
||||
import FAB from "components/FAB.vue";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import {useEventsStore} from "stores/Events";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
const routeParams = useRoute().params;
|
||||
onMounted(() => {
|
||||
fetchEvent(routeParams.id, routeParams.username);
|
||||
fetchUser(routeParams.username)
|
||||
useEventsStore().fetchDetail(routeParams.id, routeParams.username);
|
||||
useUserStore().fetchPublicUserDetail(routeParams.username);
|
||||
})
|
||||
|
||||
watch(event, (newVal) => {
|
||||
// const eventNameFormatted = eventName(newVal);
|
||||
const {isQueryRunning, event} = storeToRefs(useEventsStore());
|
||||
|
||||
watch(() => event.value, (newVal) => {
|
||||
useAppStore().setPageTitle(newVal.name);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
@@ -33,8 +31,7 @@ watch(event, (newVal) => {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<EventDetailSkeleton v-if="loading || !event"/>
|
||||
|
||||
<EventDetailSkeleton v-if="isQueryRunning || !event"/>
|
||||
|
||||
<template v-else>
|
||||
<q-banner class="bg-warning text-white q-mx-md q-my-md" v-if="!event.isPublic">
|
||||
@@ -66,6 +63,7 @@ watch(event, (newVal) => {
|
||||
<FlightsList
|
||||
v-else
|
||||
:items="event.flights"
|
||||
class="q-my-lg"
|
||||
:route-detail="{name: 'publicFlightDetail', params: {username: routeParams.username}}"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user