Uprava publikovani objektu, bugfixing
This commit is contained in:
@@ -10,6 +10,12 @@ import {useEventsStore} from "stores/Events";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {loadPage, paginationLimit} from "src/composables/pagination";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import PublishButton from "components/inputs/PublishButton.vue";
|
||||
import {useLoggedUserStore} from "stores/LoggedUser";
|
||||
import {toggleVisibility} from "src/composables/form/formHandling";
|
||||
import {TOGGLE_FLIGHT_PUBLISH} from "src/graphql/mutations/flight";
|
||||
import {useQuasar} from "quasar";
|
||||
import CopyLinkButton from "components/inputs/CopyLinkButton.vue";
|
||||
|
||||
const eventId = parseInt(useRoute().params.id);
|
||||
onMounted(() => {
|
||||
@@ -32,6 +38,13 @@ const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
});
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
const $q = useQuasar();
|
||||
const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useEventsStore(), object: event.value, variables
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -52,6 +65,16 @@ const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRef
|
||||
</q-item>
|
||||
</q-list>
|
||||
|
||||
<PublishButton
|
||||
:url-prefix="`${loggedUser.publicUsername}/udalosti/`"
|
||||
:is-public="event.isPublic"
|
||||
:require-url-slug="event.urlSlug === ''"
|
||||
@change-visibility="togglePublicVisibility"
|
||||
/>
|
||||
<CopyLinkButton
|
||||
:route="{name: 'publicEventDetail', params: {username: loggedUser.publicUsername, eventSlug: event.urlSlug}}"
|
||||
/>
|
||||
|
||||
<article v-html="event.description"/>
|
||||
|
||||
<h3>Lety</h3>
|
||||
|
||||
Reference in New Issue
Block a user