fix: Set organization after creation
This commit is contained in:
@@ -36,7 +36,9 @@
|
||||
import * as z from 'zod'
|
||||
import { useBetterAuth } from '~/composables/useBetterAuth'
|
||||
|
||||
const emit = defineEmits(['formSubmitted'])
|
||||
const emit = defineEmits<{
|
||||
(e: 'organizationCreated', id: string | undefined): void
|
||||
}>()
|
||||
|
||||
const { createOrganization } = useBetterAuth()
|
||||
const open = ref(false)
|
||||
@@ -92,8 +94,8 @@ async function onSubmit() {
|
||||
|
||||
if (!state.name || !state.slug) return
|
||||
|
||||
await createOrganization(state.name, state.slug, state.logo)
|
||||
emit('formSubmitted', { name: state.name, slug: state.slug })
|
||||
const organization = await createOrganization(state.name, state.slug, state.logo)
|
||||
emit('organizationCreated', organization.data?.id)
|
||||
loading.value = false
|
||||
open.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user