diff --git a/src/pages/EditListPage.vue b/src/pages/EditListPage.vue index 8210324c..81bd81ea 100644 --- a/src/pages/EditListPage.vue +++ b/src/pages/EditListPage.vue @@ -2,7 +2,7 @@ - +
@@ -12,12 +12,10 @@
-
- Edit list -
+

Edit list

-
+ + + + - + + + + + Move list + + + + + + + + + + + + + {{ $t('global.save') }} - --> + + + + + {{ $t('board.list.delete') }} + - - - - - - - - Move list - - - - - - - - - - - - - Save - - - - {{ $t('board.list.delete') }} -
- + @@ -275,6 +274,8 @@ export default { this.loading = true; await this.$store.dispatch('LOAD_BOARD', this.$route.params.id) + + // TODO: set default values this.list = JSON.parse(JSON.stringify(this.board.lists[this.$route.params.listIndex])); const hasGames = this.list?.games?.length > 0; @@ -334,8 +335,17 @@ export default { this.$bvToast.toast('List saved'); }, - saveList() { - console.log('save list'); + async saveChanges() { + const board = { ...this.board }; + board.lists[this.listIndex] = this.list; + + this.saving = true; + + await this.$store.dispatch('SAVE_GAME_BOARD', board); + + this.saving = false; + + this.$router.push({ name: 'board', params: { id: board.id }}); }, }, }; @@ -344,9 +354,10 @@ export default {