deleted items

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-07-12 10:50:31 +02:00
committed by Julius Härtl
parent fcabdbdc24
commit 10b7d8b335
7 changed files with 88 additions and 20 deletions

View File

@@ -63,7 +63,11 @@ export default {
}
},
assignCardToMe(state, card) {
// let existingIndex = state.cards.findIndex(_card => _card.id === card.id)
console.log(card)
let existingIndex = state.cards.findIndex(_card => _card.id === card.id)
if (existingIndex !== -1) {
}
}
},
actions: {

View File

@@ -28,7 +28,9 @@ const apiClient = new StackApi()
export default {
state: {
stacks: []
stacks: [],
deletedStacks: [],
deletedCards: []
},
getters: {
stacksByBoard: state => (id) => {
@@ -64,6 +66,12 @@ export default {
if (existingIndex !== -1) {
state.stacks[existingIndex].title = stack.title
}
},
setDeletedStacks(state, delStacks) {
state.deletedStacks.push(delStacks)
},
setDeletedCards(state, delCards) {
state.deletedCards.push(delCards)
}
},
actions: {
@@ -112,6 +120,16 @@ export default {
.then((stack) => {
commit('updateStack', stack)
})
},
deletedItems({ commit }, boardId) {
apiClient.deletedStacks(boardId)
.then((deletedStacks) => {
commit('setDeletedStacks', deletedStacks)
})
apiClient.deletedCards(boardId)
.then((deletedCards) => {
commit('setDeletedCards', deletedCards)
})
}
}
}