Add course session id to payload, re-add button for testing the payload

This commit is contained in:
Ramon Wenger 2022-12-28 17:05:53 +01:00
parent 9d848c3f9b
commit 799768da22
1 changed files with 10 additions and 2 deletions

View File

@ -81,7 +81,7 @@ genommen u. aufgegriffen."
:label="coursePositiveFeedbackLabel"
class="mb-8"
/>
<!-- <button class="btn-blue" @click="sendFeedback">Senden und abschliessen</button>-->
<button class="btn-blue" @click="sendFeedback">Senden und abschliessen</button>
<button class="btn-blue mr-4" :disabled="stepNo <= 0" @click="previousStep">
Zurück
</button>
@ -116,12 +116,18 @@ import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
import ItTextarea from "@/components/ui/ItTextarea.vue";
import { graphql } from "@/gql/";
import type { SendFeedbackInput } from "@/gql/graphql";
import { useSetupCourseSessionsStore } from "@/stores/courseSessions";
import type { LearningContent } from "@/types";
import { useMutation } from "@urql/vue";
import log from "loglevel";
import { reactive, ref } from "vue";
import { onMounted, reactive, ref } from "vue";
const props = defineProps<{ page: LearningContent }>();
const courseSessionsStore = useSetupCourseSessionsStore();
onMounted(async () => {
log.debug("Feedback mounted");
});
const stepNo = ref(0);
const MAX_STEPS = 10;
@ -175,6 +181,7 @@ const nextStep = () => {
const sendFeedback = () => {
log.info("sending feedback");
const courseSession = courseSessionsStore.courseSessionForRoute;
const input: SendFeedbackInput = reactive({
materialsRating,
courseNegativeFeedback,
@ -188,6 +195,7 @@ const sendFeedback = () => {
receivedMaterials,
wouldRecommend,
page: props.page.translation_key,
courseSession: courseSession.id,
});
const variables = reactive({
input,