Skip to content

Commit

Permalink
enh: share context to user
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
  • Loading branch information
enjeck committed Apr 11, 2024
1 parent 3ff2750 commit 56396a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/modules/modals/EditContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 6 additions & 1 deletion src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {

Check failure on line 344 in src/store/store.js

View workflow job for this annotation

GitHub Actions / NPM lint

'share' is never reassigned. Use 'const' instead
nodeType: 'context',
nodeId: id,
displayMode: 2,
}

try {
res = await axios.put(generateOcsUrl('/apps/tables/api/2/contexts/' + id), data)
Expand Down

0 comments on commit 56396a4

Please sign in to comment.