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 }