live updates: remove deleted cards with loadStacks() and not just append them

Signed-off-by: chandi Langecker <git@chandi.it>
This commit is contained in:
chandi Langecker
2022-11-22 13:23:07 +01:00
committed by Julius Härtl
parent 41d8867bdd
commit 2e6b20d71d
2 changed files with 14 additions and 1 deletions

View File

@@ -84,14 +84,16 @@ export default {
call = 'loadArchivedStacks'
}
const stacks = await apiClient[call](boardId)
const cards = []
for (const i in stacks) {
const stack = stacks[i]
for (const j in stack.cards) {
commit('addCard', stack.cards[j])
cards.push(stack.cards[j])
}
delete stack.cards
commit('addStack', stack)
}
commit('setCards', cards)
},
createStack({ commit }, stack) {
stack.boardId = this.state.currentBoard.id