diff --git a/web/src/components/Timeline.vue b/web/src/components/Timeline.vue index 97c8463..88bfa94 100644 --- a/web/src/components/Timeline.vue +++ b/web/src/components/Timeline.vue @@ -40,10 +40,10 @@
- +
@@ -58,10 +58,10 @@
- +
@@ -77,11 +77,12 @@ import {mapActions, mapGetters} from "vuex"; import TimelineAssignment from "@/components/TimelineAssignment.vue"; import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue"; import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue"; +import AsyncButton from "@/components/inputs/AsyncButton.vue"; export default { name: 'Timeline', components: { - TimelineShippingVoucher, + TimelineShippingVoucher, AsyncButton, TimelineRelatedItem, TimelineAssignment, TimelineStateChange, TimelineComment, TimelineMail }, props: { @@ -103,18 +104,15 @@ export default { }, }, methods: { - ...mapActions(['fetchShippingVouchers']), - sendMailAndClear: function () { - this.$emit('sendMail', this.newMail); + ...mapActions(['sendMail', 'postComment']), + sendMailAndClear: async function () { + await this.sendMail(this.newMail); this.newMail = ""; }, - addCommentAndClear: function () { - this.$emit('addComment', this.newComment); + addCommentAndClear: async function () { + await this.postComment(this.newComment); this.newComment = ""; } - }, - mounted() { - this.fetchShippingVouchers(); } }; diff --git a/web/src/components/inputs/AsyncButton.vue b/web/src/components/inputs/AsyncButton.vue new file mode 100644 index 0000000..a3c1712 --- /dev/null +++ b/web/src/components/inputs/AsyncButton.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file