Skip to content

Commit

Permalink
Merge pull request #13 from SlovakNationalGallery/MG-55-view-count
Browse files Browse the repository at this point in the history
Increment view count from item detail
  • Loading branch information
rastislav-chynoransky committed May 15, 2024
2 parents 15964a0 + fb38b7b commit 33f6d08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pages/items/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,9 @@ const item = computed(() => new Item(itemData.data.value))
const similars = computed(() => similarData.data.value?.data.map((item) => new Item(item)) ?? [])
const itemsToShow = computed(() => (width.value < 768 ? 1 : width.value < 1024 ? 2 : 3))
useFetch(`/api/v1/items/${id}/views`, {
baseURL: nuxtConfig.public.APP_URL,
method: 'POST',
})
</script>

0 comments on commit 33f6d08

Please sign in to comment.