Breadcrumbs resit pres funkce
This commit is contained in:
@@ -24,6 +24,7 @@ import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import {onMounted} from "vue";
|
||||
import PhotoGallerySkeleton from "components/photos/skeletons/PhotoGallerySkeleton.vue";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
import {publicPOIBaseBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const {pointOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
||||
const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore());
|
||||
@@ -36,23 +37,16 @@ useMeta(() => metaData({
|
||||
description: pointOfInterest.value.description,
|
||||
}));
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: 'publicPOIs'}, label: "Místa"},
|
||||
...publicPOIBaseBreadcrumbs(),
|
||||
{label: pointOfInterest.value.name}
|
||||
]);
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {pointOfInterestId: pointOfInterest.value.id};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic,
|
||||
appendItems
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
usePhotosStore().fetchPublic({pointOfInterestId: pointOfInterest.value.id});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -85,7 +79,7 @@ onMounted(() => {
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</q-card-section>
|
||||
</template>
|
||||
|
||||
@@ -8,26 +8,23 @@ import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
import ListFilters from "components/ListFilters.vue";
|
||||
import {homepageBreadcrumbs, publicPOIBaseBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("Místa");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{label: "Místa"},
|
||||
]);
|
||||
useAppStore().setBreadcrumbs(publicPOIBaseBreadcrumbs());
|
||||
useMeta(() => metaData({
|
||||
title: "Místa"
|
||||
}))
|
||||
|
||||
const {filters, loadPage, paginationOffset, paginationLimit} = usePagination();
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: usePointsOfInterestStore().fetchPublic, appendItems
|
||||
const {filters, loadPage, paginationOffset, paginationLimit} = usePagination({
|
||||
fetchFunction: usePointsOfInterestStore().fetchPublic
|
||||
});
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
|
||||
const handleFiltersChanged = (newFilters) => {
|
||||
paginationOffset.value = 0;
|
||||
filters.value = newFilters;
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
}
|
||||
|
||||
const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
||||
@@ -45,7 +42,7 @@ const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePoint
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user