From 53a3a67fef281bdab0dd49c27ec4c9d2992ad148 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Fri, 8 Dec 2023 18:32:56 +0100 Subject: [PATCH] fix: bust completion data on feedback submit so that it gets reloaded automatically --- .../learningContentPage/feedback/FeedbackBase.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue index c76bf24b..0da667ea 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue @@ -8,6 +8,8 @@ import { useRouteQuery } from "@vueuse/router"; import log from "loglevel"; import { computed, onMounted, reactive, ref } from "vue"; import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; +import { bustItGetCache } from "@/fetchHelpers"; +import { useUserStore } from "@/stores/user"; const props = defineProps<{ content: LearningContentFeedbackVV | LearningContentFeedbackUK; @@ -131,6 +133,9 @@ function mutateFeedback(data: FeedbackData, submit = false) { feedbackSubmitted.value = result.data?.send_feedback?.feedback_response?.submitted || false; } + bustItGetCache( + `/api/course/completion/${courseSession.value.id}/${useUserStore().id}/` + ); }) .catch((e) => log.error(e)); }