23 lines
598 B
Vue
23 lines
598 B
Vue
<template>
|
|
<Voyage
|
|
:voyage="voyagesLinksStore.currentVoyageLink?.voyage"
|
|
:voyageData="voyageStore.getVoyageData"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const route = useRoute()
|
|
const voyagesLinksStore = useVoyagesLinksStore()
|
|
const voyageStore = useVoyageStore()
|
|
|
|
// When accessing /posts/1, route.params.id will be 1
|
|
const linkId = route.params.id as string
|
|
if (
|
|
voyagesLinksStore.currentVoyageLink?.id &&
|
|
voyagesLinksStore.currentVoyageLink.id == linkId
|
|
) {
|
|
// nothing to fetch, already in the store
|
|
} else {
|
|
await voyagesLinksStore.setCurrentVoyageLink(linkId)
|
|
}
|
|
</script>
|