diff options
author | dartcafe <github@dartcafe.de> | 2020-08-12 22:48:54 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-08-12 22:48:54 +0300 |
commit | ab6c0fe12c00a569bbb4252c76cb37a924ef9100 (patch) | |
tree | fde18ce0d332de533fe26e635295e1f175f86882 /src/js/store/modules/subModules/shares.js | |
parent | a7d96426e31d8853a2def37c587b27fe1c1ff3f6 (diff) |
added sharing to contact groups
Diffstat (limited to 'src/js/store/modules/subModules/shares.js')
-rw-r--r-- | src/js/store/modules/subModules/shares.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/js/store/modules/subModules/shares.js b/src/js/store/modules/subModules/shares.js index c684e297..940aeeb5 100644 --- a/src/js/store/modules/subModules/shares.js +++ b/src/js/store/modules/subModules/shares.js @@ -62,15 +62,18 @@ const mutations = { const getters = { invitation: state => { - const invitationTypes = ['user', 'group', 'email', 'external', 'contact'] + // share types, which will be active, after the user gets his invitation + const invitationTypes = ['email', 'external', 'contact'] + // sharetype which are active without sending an invitation + const directShareTypes = ['user', 'group'] return state.list.filter(share => { - return invitationTypes.includes(share.type) && share.invitationSent + return (invitationTypes.includes(share.type) && share.invitationSent) || directShareTypes.includes(share.type) }) }, unsentInvitations: state => { return state.list.filter(share => { - return (share.userEmail || share.type === 'group') && !share.invitationSent + return (share.userEmail || share.type === 'group' || share.type === 'contactGroup') && !share.invitationSent }) }, @@ -140,6 +143,21 @@ const actions = { throw error }) }, + + resolveContactGroup(context, payload) { + const endPoint = 'apps/polls/share/resolveContactGroup' + return axios.post(generateUrl(endPoint.concat('/', payload.share.token))) + .then((response) => { + response.data.shares.forEach((item) => { + context.commit('add', item) + }) + return response + }) + .catch((error) => { + console.error('Error exploding group', { error: error.response }, { payload: payload }) + throw error + }) + }, } export default { namespaced, state, mutations, actions, getters } |