diff options
| -rw-r--r-- | lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php | 4 | ||||
| -rw-r--r-- | resources/vue/components/courseware/CoursewareStructuralElement.vue | 6 |
2 files changed, 2 insertions, 8 deletions
diff --git a/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php b/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php index 47ada63..4c9525b 100644 --- a/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php +++ b/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php @@ -81,8 +81,8 @@ class StructuralElementsCreate extends JsonApiController 'title' => self::arrayGet($json, 'data.attributes.title', ''), 'purpose' => self::arrayGet($json, 'data.attributes.purpose', $parent->purpose), 'payload' => self::arrayGet($json, 'data.attributes.payload', ''), - 'read_approval' => self::arrayGet($json, 'data.attributes.read-approval', []), - 'write_approval' => self::arrayGet($json, 'data.attributes.write-approval', []), + 'read_approval' => self::arrayGet($json, 'data.attributes.read-approval', $parent->read_approval), + 'write_approval' => self::arrayGet($json, 'data.attributes.write-approval', $parent->write_approval), 'position' => $parent->countChildren() ]); diff --git a/resources/vue/components/courseware/CoursewareStructuralElement.vue b/resources/vue/components/courseware/CoursewareStructuralElement.vue index af5331b..5332226 100644 --- a/resources/vue/components/courseware/CoursewareStructuralElement.vue +++ b/resources/vue/components/courseware/CoursewareStructuralElement.vue @@ -1518,8 +1518,6 @@ export default { const title = this.newChapterName; // this is the title of the new element const purpose = this.newChapterPurpose; let parent_id = this.currentId; // new page is descandant as default - let writeApproval = this.currentElement.attributes['write-approval']; - let readApproval = this.currentElement.attributes['read-approval']; this.errorEmptyChapterName = title.trim(); if (this.errorEmptyChapterName === '') { @@ -1527,16 +1525,12 @@ export default { } if (this.newChapterParent === 'sibling') { parent_id = this.structuralElement.relationships.parent.data.id; - writeApproval = []; - readApproval = []; } this.showElementAddDialog(false); this.createStructuralElement({ attributes: { title: title, purpose: purpose, - 'write-approval': writeApproval, - 'read-approval': readApproval }, templateId: this.newChapterTemplate ? this.newChapterTemplate.id : null, parentId: parent_id, |
