From d847c58d24971fce81e4d5b8ddb0f63b1698d4be Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 8 Jun 2023 04:19:37 +0200 Subject: [PATCH] Changed stash routing. --- assets/components/stashes/add.vue | 28 +++++++++++++++++++++++----- assets/components/stashes/stash.vue | 2 ++ assets/components/users/stash.vue | 4 ++-- assets/css/_forms.scss | 8 ++++++++ assets/css/_theme.scss | 2 +- assets/js/router.js | 4 ++-- assets/js/stashes/actions.js | 18 +++++++++++++----- src/stashes.js | 16 ++++++++++++---- src/store-releases.js | 3 +-- 9 files changed, 64 insertions(+), 21 deletions(-) diff --git a/assets/components/stashes/add.vue b/assets/components/stashes/add.vue index 0da5174c..8f45bb60 100755 --- a/assets/components/stashes/add.vue +++ b/assets/components/stashes/add.vue @@ -7,6 +7,11 @@ class="dialog-body" @submit.prevent="addStash" > +
{{ errorMsg }}
+ async function addStash() { - await this.$store.dispatch('createStash', { - name: this.name, - }); + this.errorMsg = null; - this.$emit('close', true); + try { + await this.$store.dispatch('createStash', { + name: this.name, + }); + + this.$emit('close', true); + } catch (error) { + this.errorMsg = error.message; + } } function mounted() { @@ -39,15 +50,22 @@ function mounted() { } export default { + emits: ['close'], data() { return { + errorMsg: null, name: null, }; }, - emits: ['close'], mounted, methods: { addStash, }, }; + + diff --git a/assets/components/stashes/stash.vue b/assets/components/stashes/stash.vue index aea08ea6..021aea26 100755 --- a/assets/components/stashes/stash.vue +++ b/assets/components/stashes/stash.vue @@ -115,6 +115,8 @@ import Pagination from '../pagination/pagination.vue'; async function fetchStash() { this.stash = await this.$store.dispatch('fetchStash', { stashId: this.$route.params.stashId, + stashSlug: this.$route.params.stashSlug, + username: this.$route.params.username, section: this.$route.params.range, pageNumber: this.$route.params.pageNumber || 1, limit: this.limit, diff --git a/assets/components/users/stash.vue b/assets/components/users/stash.vue index 058b5bc1..cd18c083 100755 --- a/assets/components/users/stash.vue +++ b/assets/components/users/stash.vue @@ -1,13 +1,13 @@