add view count
This commit is contained in:
@@ -156,7 +156,7 @@
|
|||||||
import { computed, onMounted, ref } from "vue"
|
import { computed, onMounted, ref } from "vue"
|
||||||
import { useRouter } from "vue-router"
|
import { useRouter } from "vue-router"
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { Showcase } from "../api"
|
import { Showcase, Submission } from "../api"
|
||||||
import type { PromptRound, ShowcaseDetail } from "../utils/type"
|
import type { PromptRound, ShowcaseDetail } from "../utils/type"
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -221,6 +221,7 @@ function onCollapseChange(
|
|||||||
async function init() {
|
async function init() {
|
||||||
try {
|
try {
|
||||||
detail.value = await Showcase.getDetail(props.id)
|
detail.value = await Showcase.getDetail(props.id)
|
||||||
|
void Submission.incrementView(props.id)
|
||||||
} catch {
|
} catch {
|
||||||
notFound.value = true
|
notFound.value = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user