From 55d4ea6080c961dc0298cef836de1e5c7f71798b Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Wed, 9 Nov 2022 21:08:56 +0100 Subject: [PATCH] Reload completion data correctly --- client/src/pages/CockpitPage.vue | 5 ++++- client/src/stores/completion.ts | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/pages/CockpitPage.vue b/client/src/pages/CockpitPage.vue index 2556d10c..873f4dc0 100644 --- a/client/src/pages/CockpitPage.vue +++ b/client/src/pages/CockpitPage.vue @@ -37,7 +37,10 @@ onMounted(async () => {

Kurse

-
+

{{ courseSession.title }}

diff --git a/client/src/stores/completion.ts b/client/src/stores/completion.ts index 3d422aa6..04b81471 100644 --- a/client/src/stores/completion.ts +++ b/client/src/stores/completion.ts @@ -1,4 +1,4 @@ -import { itGetCached, itPost } from "@/fetchHelpers"; +import { bustItGetCache, itGetCached, itPost } from "@/fetchHelpers"; import type { BaseCourseWagtailPage, CourseCompletion } from "@/types"; import { defineStore } from "pinia"; @@ -32,8 +32,9 @@ export const useCompletionStore = defineStore({ completion_status: page.completion_status, }); - if (completionData) { + if (completionData && completionData.length > 0) { this.completionData = completionData; + bustItGetCache(`/api/course/completion/${completionData[0].course}/`); } return this.completionData || [];