From 770142232c87212892944bc580e10d81a56235e7 Mon Sep 17 00:00:00 2001 From: Jakob Date: Wed, 3 Jul 2019 11:38:12 +0200 Subject: [PATCH] sharing impl Signed-off-by: Jakob --- src/components/board/Stack.vue | 1 - src/store/card.js | 1 - src/store/main.js | 14 +++++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/board/Stack.vue b/src/components/board/Stack.vue index b6b7680a7..765332562 100644 --- a/src/components/board/Stack.vue +++ b/src/components/board/Stack.vue @@ -61,7 +61,6 @@ import { Container, Draggable } from 'vue-smooth-dnd' import CardItem from '../cards/CardItem' -import { mapState } from 'vuex' export default { name: 'Stack', diff --git a/src/store/card.js b/src/store/card.js index f1d48f5d8..b354acefc 100644 --- a/src/store/card.js +++ b/src/store/card.js @@ -20,7 +20,6 @@ * */ -import Vue from 'vue' import { CardApi } from './../services/CardApi' const apiClient = new CardApi() diff --git a/src/store/main.js b/src/store/main.js index 9ca218366..accf49879 100644 --- a/src/store/main.js +++ b/src/store/main.js @@ -171,7 +171,6 @@ export default new Vuex.Store({ // acl mutators addAclToCurrentBoard(state, createdAcl) { state.currentBoard.acl[createdAcl.id] = createdAcl - console.log(state.currentBoard) }, updateAclFromCurrentBoard(state, acl) { for (var acl_ in state.currentBoard.acl) { @@ -182,12 +181,17 @@ export default new Vuex.Store({ } }, deleteAclFromCurrentBoard(state, acl) { - const removeIndex = state.currentBoard.acl.findIndex((a) => { - return a.participant.uid === acl.participant.uid - }) + let removeIndex = -1 + for (var index in state.currentBoard.acl) { + var attr = state.currentBoard.acl[index] + if (acl.id === attr.id) { + removeIndex = index + break + } + } if (removeIndex > -1) { - state.currentBoard.acl.splice(removeIndex, 1) + delete state.currentBoard.acl[removeIndex] } } },