Skip to content
Snippets Groups Projects
Commit 0a83654f authored by permcu's avatar permcu
Browse files

Implement saveTopic and wire documentation mutation up

parent 1b19258a
No related branches found
No related tags found
2 merge requests!352Draft: Resolve "Add dialog with each lesson's students",!350Resolve "Add simple course book list"
<template>
<div class="full-width d-flex flex-column flex-md-row align-stretch">
<lesson-information
:documentation="documentation"
:documentation="documentation"
/>
<lesson-summary
:documentation="documentation"
class="flex-grow-1"
class="flex-grow-1"
:documentation="documentation"
:is-create="false"
:gql-patch-mutation="updateDocumentationsMutation"
/>
<lesson-notes
:documentation="documentation"
class="flex-grow-1"
class="flex-grow-1"
:documentation="documentation"
/>
</div>
</template>
......@@ -19,6 +21,9 @@ import LessonInformation from "./LessonInformation.vue";
import LessonSummary from "./LessonSummary.vue";
import LessonNotes from "./LessonNotes.vue";
// or pass from Coursebook?
import { gqlCreateOrUpdateDocumentations } from "../coursebook.graphql";
export default {
name: "Documentation",
components: {
......@@ -32,5 +37,10 @@ export default {
required: true,
},
},
data() {
return {
updateDocumentationsMutation: gqlCreateOrUpdateDocumentations,
};
},
};
</script>
......@@ -37,8 +37,12 @@
</template>
<script>
import createOrPatchMixin from "aleksis.core/mixins/createOrPatchMixin.js";
// TODO: Update createOrPatchMixin to handle createOrPatch update of cache
export default {
name: "LessonSummary",
mixins: [createOrPatchMixin],
props: {
documentation: {
type: Object,
......@@ -57,6 +61,10 @@ export default {
},
methods: {
saveTopic() {
this.createOrPatch([{
id: this.documentation.id,
topic: this.topic,
}]);
},
truncate(str) {
return str ?
......
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