Fix creation of creators

This commit is contained in:
2024-10-06 01:08:15 -04:00
parent b43c2f6e3c
commit 764973b342
2 changed files with 6 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ export const useCreatorProfileStore = defineStore(
return { return {
creator: value, creator: value,
hasCreator hasCreator,
fetchCurrentCreatorProfile
} }
}) })

View File

@@ -31,18 +31,20 @@ async function requestAccept(creatorName) {
const response = await client.post( const response = await client.post(
'/api/creators', '/api/creators',
{ {
'creatorId': userProfileStore.value.id, 'creatorId': userProfileStore.user.id,
'name': creatorName 'name': creatorName
}) })
if (response.status >= 200 && response.status < 300) { if (response.status >= 200 && response.status < 300) {
await creatorProfileStore.fetchCurrentCreatorProfile() currentComponent.value = null
dialog.value = false dialog.value = false
await creatorProfileStore.fetchCurrentCreatorProfile()
} else { } else {
console.log(`An issue while creating the creator: ${response.statusText}`) console.log(`An issue while creating the creator: ${response.statusText}`)
} }
} }
function requestCancel() { function requestCancel() {
currentComponent.value = null
dialog.value = false dialog.value = false
} }