Cookies v SSR

This commit is contained in:
Michal Kváček
2023-12-10 22:10:26 +01:00
parent 71389caecc
commit 9b38abd0de
10 changed files with 173 additions and 155 deletions
+9 -10
View File
@@ -1,13 +1,3 @@
<script>
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
export default {
preFetch({currentRoute, store}) {
return usePointsOfInterestStore(store).fetchPublicDetail(currentRoute.params.id);
}
}
</script>
<script setup>
import {storeToRefs} from "pinia";
import {usePhotosStore} from "stores/Photos";
@@ -21,6 +11,15 @@ import {useMeta} from "quasar";
import {metaData} from "src/composables/meta";
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
import {onServerPrefetch} from "vue";
import {useRoute} from "vue-router";
const $route = useRoute();
onServerPrefetch(() => {
return usePointsOfInterestStore().fetchPublicDetail($route.params.id);
});
const {pointOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore());