diff options
| author | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2025-05-13 11:51:42 +0000 |
|---|---|---|
| committer | Ron Lucke <lucke@elan-ev.de> | 2025-05-13 13:51:42 +0200 |
| commit | f69a3082123db28f5156d02a884756cef4e0825f (patch) | |
| tree | a4ebc3ae1c154537bf8ddf230f5a59f82643d4a4 /resources/vue/store | |
| parent | d563cb7ab5f9185fa47deb8ed79ceabd2dcc7bb6 (diff) | |
Courseware-Freigaben laufen in "vue-router" Fehlerissue-5594
Closes #5609
Merge request studip/studip!4227
Diffstat (limited to 'resources/vue/store')
| -rw-r--r-- | resources/vue/store/courseware/public-structure.module.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/resources/vue/store/courseware/public-structure.module.js b/resources/vue/store/courseware/public-structure.module.js index af8f262..fba2384 100644 --- a/resources/vue/store/courseware/public-structure.module.js +++ b/resources/vue/store/courseware/public-structure.module.js @@ -52,8 +52,35 @@ const actions = { commit('setChildren', children); const ordered = [...visitTree(children, context.rootId)]; + commit('setOrdered', ordered); }, + async load({ dispatch, rootGetters }) { + const context = rootGetters['context']; + + await dispatch('courseware-structural-elements/loadById', { + id: context.rootId, + options: { + include: 'containers,containers.blocks', + }, + }, { root: true }); + const root = rootGetters['courseware-structural-elements/byId']({id: context.rootId}); + await dispatch('loadDescendants', { root }); + }, + loadDescendants({ dispatch }, { root }) { + const parent = { id: root.id, type: root.type }; + const relationship = 'descendants'; + const options = { + 'page[offset]': 0, + 'page[limit]': 10000, + }; + + return dispatch( + 'courseware-structural-elements/loadRelated', + { parent, relationship, options }, + { root: true } + ); + }, }; function* visitTree(tree, current) { |
