From 764973b342f63f2b03bbcd0ce50667af2d9f1c53 Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Sun, 6 Oct 2024 01:08:15 -0400 Subject: [PATCH] Fix creation of creators --- src/stores/creatorProfileStore.js | 3 ++- src/views/profile/creators/CreatorPage.vue | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stores/creatorProfileStore.js b/src/stores/creatorProfileStore.js index 7b15ccd..61d7a0b 100644 --- a/src/stores/creatorProfileStore.js +++ b/src/stores/creatorProfileStore.js @@ -42,6 +42,7 @@ export const useCreatorProfileStore = defineStore( return { creator: value, - hasCreator + hasCreator, + fetchCurrentCreatorProfile } }) diff --git a/src/views/profile/creators/CreatorPage.vue b/src/views/profile/creators/CreatorPage.vue index a57e899..fbeb434 100644 --- a/src/views/profile/creators/CreatorPage.vue +++ b/src/views/profile/creators/CreatorPage.vue @@ -31,18 +31,20 @@ async function requestAccept(creatorName) { const response = await client.post( '/api/creators', { - 'creatorId': userProfileStore.value.id, + 'creatorId': userProfileStore.user.id, 'name': creatorName }) if (response.status >= 200 && response.status < 300) { - await creatorProfileStore.fetchCurrentCreatorProfile() + currentComponent.value = null dialog.value = false + await creatorProfileStore.fetchCurrentCreatorProfile() } else { console.log(`An issue while creating the creator: ${response.statusText}`) } } function requestCancel() { + currentComponent.value = null dialog.value = false }