#1472: Implement addLabelToBoardAndCard to also create Labels from the CardSidebar
Signed-off-by: Felix Schnabel <f.schnabel@tum.de>
This commit is contained in:
@@ -273,7 +273,6 @@ export default new Vuex.Store({
|
||||
labelToUpdate.color = newLabel.color
|
||||
},
|
||||
addLabelToCurrentBoard(state, newLabel) {
|
||||
|
||||
state.currentBoard.labels.push(newLabel)
|
||||
},
|
||||
|
||||
@@ -465,6 +464,16 @@ export default new Vuex.Store({
|
||||
commit('addLabelToCurrentBoard', newLabel)
|
||||
})
|
||||
},
|
||||
async addLabelToCurrentBoardAndCard({ dispatch, commit }, { newLabel, card }) {
|
||||
newLabel.boardId = this.state.currentBoard.id
|
||||
const label = await apiClient.createLabel(newLabel)
|
||||
commit('addLabelToCurrentBoard', label)
|
||||
dispatch('addLabel', {
|
||||
card,
|
||||
labelId: label.id,
|
||||
})
|
||||
return label
|
||||
},
|
||||
|
||||
// acl actions
|
||||
async addAclToCurrentBoard({ dispatch, commit }, newAcl) {
|
||||
|
||||
Reference in New Issue
Block a user