From 4ac6ac0a0b5c371370fee03c745c15ff7c09932b Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Thu, 11 Apr 2024 11:18:55 +0100 Subject: [PATCH] enh: share context to user Signed-off-by: Cleopatra Enjeck M --- src/modules/modals/EditContext.vue | 8 +------- src/store/store.js | 7 ++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/modules/modals/EditContext.vue b/src/modules/modals/EditContext.vue index 09b50cb3a..36b17d1df 100644 --- a/src/modules/modals/EditContext.vue +++ b/src/modules/modals/EditContext.vue @@ -145,13 +145,7 @@ export default { nodes: dataResources, } - const share = { - nodeType: 'context', - nodeId: this.contextId, - receiverType: 'user', - displayMode: 2, - } - const res = await this.$store.dispatch('updateContext', { id: this.contextId, data, share, receivers: this.receivers }) + const res = await this.$store.dispatch('updateContext', { id: this.contextId, data, receivers: this.receivers }) if (res) { showSuccess(t('tables', 'Updated context "{contextTitle}".', { contextTitle: this.title })) this.actionCancel() diff --git a/src/store/store.js b/src/store/store.js index 878e0ec8a..e81561b8d 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -339,8 +339,13 @@ export default new Vuex.Store({ return true }, - async updateContext({ state, commit, dispatch }, { id, data, share, receivers }) { + async updateContext({ state, commit, dispatch }, { id, data, receivers }) { let res = null + let share = { + nodeType: 'context', + nodeId: id, + displayMode: 2, + } try { res = await axios.put(generateOcsUrl('/apps/tables/api/2/contexts/' + id), data)