From 7c939c8fcfc8fd34f9afce3d9583812cecea4a1b Mon Sep 17 00:00:00 2001 From: Sondre Malerud <sondre_mal@hotmail.no> Date: Fri, 5 May 2023 14:49:46 +0200 Subject: [PATCH] bugfix --- src/views/ProfileCreationView.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/ProfileCreationView.vue b/src/views/ProfileCreationView.vue index 84ee995..56967fd 100644 --- a/src/views/ProfileCreationView.vue +++ b/src/views/ProfileCreationView.vue @@ -19,6 +19,7 @@ export default { }, methods: { async submit() { + const authStore = useAuthStore() await API.addProfile(this.profile) .then((profile) => { let id = profile.id; @@ -26,14 +27,14 @@ export default { let image = document.getElementById("profile_img").files[0]; if (typeof image === 'undefined') { - this.authStore.profile = profile; - this.authStore.profiles.push(profile); + authStore.profile = profile; + API.getProfiles(); router.push("/"); } else { API.uploadProfileImage(image, id) .then((updatedProfile) => { - this.authStore.profile = updatedProfile; - this.authStore.profiles.push(profile); + authStore.profile = updatedProfile; + API.getProfiles(); router.push("/"); }); } -- GitLab