feat: assignment in lesson

This commit is contained in:
Jannat Patel
2024-12-31 12:20:01 +05:30
parent 156d36fb5e
commit 1293294593
6 changed files with 421 additions and 312 deletions

View File

@@ -64,7 +64,14 @@ import {
FormControl,
TextEditor,
} from 'frappe-ui'
import { computed, inject, onMounted, onBeforeUnmount, reactive } from 'vue'
import {
computed,
inject,
onMounted,
onBeforeUnmount,
reactive,
watch,
} from 'vue'
import { showToast } from '@/utils'
import { useRouter } from 'vue-router'
@@ -113,11 +120,6 @@ const assignment = createDocumentResource({
doctype: 'LMS Assignment',
name: props.assignmentID,
auto: false,
onSuccess(data) {
Object.keys(data).forEach((key) => {
model[key] = data[key]
})
},
})
const newAssignment = createResource({
@@ -161,6 +163,12 @@ const saveAssignment = () => {
}
}
watch(assignment, () => {
Object.keys(assignment.doc).forEach((key) => {
model[key] = assignment.doc[key]
})
})
const breadcrumbs = computed(() => [
{
label: __('Assignments'),