fix: show card after moving into another list

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2022-03-31 22:23:27 +02:00
parent 75a17dae2c
commit 00eac849fe
2 changed files with 8 additions and 1 deletions

View File

@@ -167,10 +167,14 @@ export default {
}, },
}) })
}, },
moveCard() { async moveCard() {
this.copiedCard = Object.assign({}, this.card) this.copiedCard = Object.assign({}, this.card)
const boardId = this.card?.boardId ? this.card.boardId : this.$route.params.id
this.copiedCard.stackId = this.selectedStack.id this.copiedCard.stackId = this.selectedStack.id
this.$store.dispatch('moveCard', this.copiedCard) this.$store.dispatch('moveCard', this.copiedCard)
if (parseInt(boardId) === parseInt(this.selectedStack.boardId)) {
await this.$store.commit('addNewCard', { ...this.copiedCard })
}
this.modalShow = false this.modalShow = false
}, },
async loadStacksFromBoard(board) { async loadStacksFromBoard(board) {

View File

@@ -264,6 +264,9 @@ export default {
Vue.set(state.cards[existingIndex], 'attachmentCount', state.cards[existingIndex].attachmentCount - 1) Vue.set(state.cards[existingIndex], 'attachmentCount', state.cards[existingIndex].attachmentCount - 1)
} }
}, },
addNewCard(state, card) {
state.cards.push(card)
},
}, },
actions: { actions: {
async addCard({ commit }, card) { async addCard({ commit }, card) {