Changed stash routing.

This commit is contained in:
DebaucheryLibrarian
2023-06-08 04:19:37 +02:00
parent 81f504f33e
commit d847c58d24
9 changed files with 64 additions and 21 deletions

View File

@@ -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>