fix
This commit is contained in:
@@ -208,6 +208,10 @@ export const Submission = {
|
|||||||
return res.data
|
return res.data
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async incrementView(id: string) {
|
||||||
|
await http.post(`/submission/${id}/view`)
|
||||||
|
},
|
||||||
|
|
||||||
async updateScore(id: string, score: number) {
|
async updateScore(id: string, score: number) {
|
||||||
const res = await http.put(`/submission/${id}/score`, { score })
|
const res = await http.put(`/submission/${id}/score`, { score })
|
||||||
return res.data
|
return res.data
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const iframe = useTemplateRef<HTMLIFrameElement>("iframe")
|
|||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const submission: SubmissionAll = await Submission.get(props.id)
|
const submission: SubmissionAll = await Submission.get(props.id)
|
||||||
|
Submission.incrementView(props.id)
|
||||||
|
|
||||||
if (!iframe.value) return
|
if (!iframe.value) return
|
||||||
const doc = iframe.value.contentDocument
|
const doc = iframe.value.contentDocument
|
||||||
|
|||||||
Reference in New Issue
Block a user