Implement edit board name
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
@@ -82,6 +82,13 @@ export default new Vuex.Store({
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
/**
|
||||
* Adds or replaces a board in the store.
|
||||
* Matches a board by it's id.
|
||||
*
|
||||
* @param state
|
||||
* @param board
|
||||
*/
|
||||
addBoard(state, board) {
|
||||
const indexExisting = state.boards.findIndex((b) => {
|
||||
return board.id === b.id
|
||||
@@ -137,6 +144,17 @@ export default new Vuex.Store({
|
||||
commit('addBoard', board)
|
||||
})
|
||||
},
|
||||
/**
|
||||
* Updates a board API side.
|
||||
*
|
||||
* @param commit
|
||||
* @param board The board to update.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
async updateBoard({ commit }, board) {
|
||||
const storedBoard = await apiClient.updateBoard(board)
|
||||
commit('addBoard', storedBoard)
|
||||
},
|
||||
createBoard({ commit }, boardData) {
|
||||
apiClient.createBoard(boardData)
|
||||
.then((board) => {
|
||||
|
||||
Reference in New Issue
Block a user