forked from DebaucheryLibrarian/traxxx
Changed stash routing.
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
class="dialog-body"
|
||||
@submit.prevent="addStash"
|
||||
>
|
||||
<div
|
||||
v-if="errorMsg"
|
||||
class="form-error"
|
||||
>{{ errorMsg }}</div>
|
||||
|
||||
<input
|
||||
ref="name"
|
||||
v-model="name"
|
||||
@@ -27,11 +32,17 @@
|
||||
|
||||
<script>
|
||||
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,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user