Skip to content
Snippets Groups Projects
Commit 8d9c1c21 authored by Sondre Malerud's avatar Sondre Malerud :coffee:
Browse files

Merge branch 'register-profile-bugfix' into 'main'

bugfix

See merge request !32
parents 19e1a123 7c939c8f
No related branches found
No related tags found
1 merge request!32bugfix
Pipeline #226661 passed
...@@ -19,6 +19,7 @@ export default { ...@@ -19,6 +19,7 @@ export default {
}, },
methods: { methods: {
async submit() { async submit() {
const authStore = useAuthStore()
await API.addProfile(this.profile) await API.addProfile(this.profile)
.then((profile) => { .then((profile) => {
let id = profile.id; let id = profile.id;
...@@ -26,14 +27,14 @@ export default { ...@@ -26,14 +27,14 @@ export default {
let image = document.getElementById("profile_img").files[0]; let image = document.getElementById("profile_img").files[0];
if (typeof image === 'undefined') { if (typeof image === 'undefined') {
this.authStore.profile = profile; authStore.profile = profile;
this.authStore.profiles.push(profile); API.getProfiles();
router.push("/"); router.push("/");
} else { } else {
API.uploadProfileImage(image, id) API.uploadProfileImage(image, id)
.then((updatedProfile) => { .then((updatedProfile) => {
this.authStore.profile = updatedProfile; authStore.profile = updatedProfile;
this.authStore.profiles.push(profile); API.getProfiles();
router.push("/"); router.push("/");
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment