Add course session id to payload, re-add button for testing the payload
This commit is contained in:
parent
9d848c3f9b
commit
799768da22
|
|
@ -81,7 +81,7 @@ genommen u. aufgegriffen."
|
||||||
:label="coursePositiveFeedbackLabel"
|
:label="coursePositiveFeedbackLabel"
|
||||||
class="mb-8"
|
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">
|
<button class="btn-blue mr-4" :disabled="stepNo <= 0" @click="previousStep">
|
||||||
Zurück
|
Zurück
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -116,12 +116,18 @@ import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
|
||||||
import ItTextarea from "@/components/ui/ItTextarea.vue";
|
import ItTextarea from "@/components/ui/ItTextarea.vue";
|
||||||
import { graphql } from "@/gql/";
|
import { graphql } from "@/gql/";
|
||||||
import type { SendFeedbackInput } from "@/gql/graphql";
|
import type { SendFeedbackInput } from "@/gql/graphql";
|
||||||
|
import { useSetupCourseSessionsStore } from "@/stores/courseSessions";
|
||||||
import type { LearningContent } from "@/types";
|
import type { LearningContent } from "@/types";
|
||||||
import { useMutation } from "@urql/vue";
|
import { useMutation } from "@urql/vue";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
|
||||||
const props = defineProps<{ page: LearningContent }>();
|
const props = defineProps<{ page: LearningContent }>();
|
||||||
|
const courseSessionsStore = useSetupCourseSessionsStore();
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
log.debug("Feedback mounted");
|
||||||
|
});
|
||||||
|
|
||||||
const stepNo = ref(0);
|
const stepNo = ref(0);
|
||||||
const MAX_STEPS = 10;
|
const MAX_STEPS = 10;
|
||||||
|
|
@ -175,6 +181,7 @@ const nextStep = () => {
|
||||||
|
|
||||||
const sendFeedback = () => {
|
const sendFeedback = () => {
|
||||||
log.info("sending feedback");
|
log.info("sending feedback");
|
||||||
|
const courseSession = courseSessionsStore.courseSessionForRoute;
|
||||||
const input: SendFeedbackInput = reactive({
|
const input: SendFeedbackInput = reactive({
|
||||||
materialsRating,
|
materialsRating,
|
||||||
courseNegativeFeedback,
|
courseNegativeFeedback,
|
||||||
|
|
@ -188,6 +195,7 @@ const sendFeedback = () => {
|
||||||
receivedMaterials,
|
receivedMaterials,
|
||||||
wouldRecommend,
|
wouldRecommend,
|
||||||
page: props.page.translation_key,
|
page: props.page.translation_key,
|
||||||
|
courseSession: courseSession.id,
|
||||||
});
|
});
|
||||||
const variables = reactive({
|
const variables = reactive({
|
||||||
input,
|
input,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue