add view count
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-05-05 19:16:58 -06:00
parent 4af9ae90c9
commit 9a8e5ad48e

View File

@@ -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
} }