change route after board duplication
Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
@@ -131,16 +131,20 @@ export default {
|
||||
})
|
||||
|
||||
actions.push({
|
||||
action: () => {
|
||||
action: async () => {
|
||||
this.hideMenu()
|
||||
this.loading = true
|
||||
this.$store.dispatch('cloneBoard', this.board).then((newBoard) => {
|
||||
try {
|
||||
const newBoard = await this.$store.dispatch('cloneBoard', this.board)
|
||||
|
||||
this.loading = false
|
||||
this.editTitle = this.board.title
|
||||
this.editColor = '#' + this.board.color
|
||||
this.editing = true
|
||||
|
||||
})
|
||||
const route = this.routeTo
|
||||
route.params.id = newBoard.id
|
||||
this.$router.push(route)
|
||||
}
|
||||
catch {
|
||||
OC.Notification.showTemporary(t('deck', 'An error occurred'))
|
||||
}
|
||||
},
|
||||
icon: 'icon-clone',
|
||||
text: t('deck', 'Clone board')
|
||||
|
||||
@@ -281,10 +281,16 @@ export default new Vuex.Store({
|
||||
})
|
||||
},
|
||||
cloneBoard({ commit }, boardData) {
|
||||
apiClient.cloneBoard(boardData)
|
||||
.then((board) => {
|
||||
commit('cloneBoard', board)
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
apiClient.cloneBoard(boardData)
|
||||
.then((board) => {
|
||||
commit('cloneBoard', board)
|
||||
resolve(board)
|
||||
})
|
||||
.catch((err) => {
|
||||
return reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
removeBoard({ commit }, board) {
|
||||
commit('removeBoard', board)
|
||||
|
||||
Reference in New Issue
Block a user