Skip to content
Snippets Groups Projects
Commit bef8f990 authored by Ron Lucke's avatar Ron Lucke
Browse files

fix #1699

Closes #1699

Merge request studip/studip!1100
parent ba00cb55
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +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', []),
'position' => $parent->countChildren()
]);
......
......@@ -1576,6 +1576,8 @@ export default {
async createElement() {
let title = this.newChapterName; // this is the title of the new element
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 === '') {
......@@ -1583,11 +1585,15 @@ export default {
}
if (this.newChapterParent === 'sibling') {
parent_id = this.structuralElement.relationships.parent.data.id;
writeApproval = [];
readApproval = [];
}
this.showElementAddDialog(false);
await this.createStructuralElement({
attributes: {
title,
title: title,
'write-approval': writeApproval,
'read-approval': readApproval
},
parentId: parent_id,
currentId: this.currentId,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment