Commit 87ca75a3 authored by Simon Knox's avatar Simon Knox

move board delete to Service

parent d5635118
......@@ -15,10 +15,6 @@ const Store = gl.issueBoards.BoardsStore;
export default {
props: {
boardPath: {
type: String,
required: true,
},
canAdminBoard: {
type: Boolean,
required: true,
......@@ -130,7 +126,7 @@ export default {
submit() {
if (this.isDeleteForm) {
this.submitDisabled = true;
this.$http.delete(this.boardPath)
gl.boardService.deleteBoard(this.currentBoard)
.then(() => {
gl.utils.visitUrl(Store.rootPath);
})
......@@ -153,11 +149,11 @@ export default {
Store.state.currentPage = '';
},
resetFormState() {
if (this.currentBoard && Object.keys(this.currentBoard).length && this.isEditForm) {
Store.updateBoardConfig(this.currentBoard);
} else if (this.isNewForm) {
if (this.isNewForm) {
// Clear the form when we open the "New board" modal
Store.updateBoardConfig();
} else if (this.currentBoard && Object.keys(this.currentBoard).length) {
Store.updateBoardConfig(this.currentBoard);
}
},
},
......
......@@ -46,6 +46,10 @@ class BoardService {
return this.boards.save({}, { board });
}
deleteBoard ({ id }) {
return this.boards.delete({ id });
}
all () {
return this.lists.get();
}
......
......@@ -36,7 +36,6 @@
Delete board
%board-form{ ":milestone-path" => "milestonePath",
"board-path" => current_board_path(board),
"labels-path" => labels_filter_path(true),
"project-id" => @project&.id,
"group-id" => @group&.id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment