Skip to content
Snippets Groups Projects
Verified Commit c8136f41 authored by magicfelix's avatar magicfelix
Browse files

Adjust frontend GraphQL mutation

parent e62399df
No related branches found
No related tags found
1 merge request!284Draft: Redesign entering of lesson documentation
...@@ -43,7 +43,11 @@ export default { ...@@ -43,7 +43,11 @@ export default {
computed: { computed: {
lessonDocumentationMutationInputObject() { lessonDocumentationMutationInputObject() {
return { return {
id: this.id, year: this.year,
week: this.week,
lessonPeriodId: this.lessonPeriod ? this.lessonPeriod.id : null,
eventId: this.event ? this.event.id : null,
extraLessonId: this.extraLesson ? this.extraLesson.id : null,
topic: this.editTopic, topic: this.editTopic,
groupNote: this.editGroupNote, groupNote: this.editGroupNote,
homework: this.editHomework, homework: this.editHomework,
...@@ -59,18 +63,18 @@ export default { ...@@ -59,18 +63,18 @@ export default {
template: ` template: `
<ApolloMutation <ApolloMutation
:mutation="gql => gql\` :mutation="gql => gql\`
mutation UpdateLessonDocumentation($input: LessonDocumentationMutationInput!) { mutation UpdateLessonDocumentation($year:Int!, $week:Int!, $lessonPeriodId:ID, $topic:String, $homework:String, $groupNote:String){
updateLessonDocumentation(input: $input) { updateOrCreateLessonDocumentation(year:$year, week:$week, lessonPeriodId:$lessonPeriodId, topic:$topic, homework:$homework, groupNote:$groupNote){
lessonDocumentation { lessonDocumentation{
id id
topic topic
groupNote
homework homework
groupNote
} }
} }
} }
\`" \`"
:variables="{ input: lessonDocumentationMutationInputObject }" :variables=lessonDocumentationMutationInputObject
@done="onDone" @done="onDone"
> >
<template v-slot="{ mutate, loading, error }"> <template v-slot="{ mutate, loading, error }">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment