new functions

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-07-16 14:17:51 +02:00
committed by Julius Härtl
parent 70d3fba187
commit 38dc7945dd
8 changed files with 141 additions and 29 deletions

View File

@@ -64,10 +64,18 @@ export default {
},
assignCardToMe(state, card) {
console.log(card)
let existingIndex = state.cards.findIndex(_card => _card.id === card.id)
if (existingIndex !== -1) {
// let existingIndex = state.cards.findIndex(_card => _card.id === card.id)
/* if (existingIndex !== -1) {
}
} */
},
updateCard(state, card) {
// console.log(card)
// new card is not returned!
// let existingIndex = state.cards.findIndex(_card => _card.id === card.id)
/* if (existingIndex !== -1) {
state.cards[existingIndex] = card
} */
}
},
actions: {
@@ -105,6 +113,12 @@ export default {
.then((card) => {
commit('assignCardToMe', card)
})
},
assignLabel({ commit }, data) {
apiClient.assignLabelToCard(data)
.then((card) => {
commit('updateCard', card)
})
}
}
}