From 5a8c3920e18dc56686ac2b9a6cc084f08d68ac5d Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sat, 26 Feb 2022 17:09:56 +0100 Subject: [PATCH] Fetch tickets after creating example content --- src/App.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 30857c4..2c5dd09 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,13 +46,14 @@ export default { $route: 'fetchTickets', }, created() { - this.createExampleContent() - this.fetchTickets() + this.createExampleContent().finally(() => { + this.fetchTickets() + }) }, methods: { - createExampleContent() { + async createExampleContent() { // this obviously shouldn't survive version 1.0 - axios.post( + await axios.post( 'api/v1/tickets', { title: 'Ein Ticket', content: 'Ein Beispiel' }, { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } },