fix(frontend): Better Auth list organizations
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<div class="flex justify-between items-center">
|
||||
<USelect
|
||||
v-model="selectedOrgId"
|
||||
:items="selectItems"
|
||||
:items="availableOrganizations"
|
||||
value-key="value"
|
||||
placeholder="Select organization"
|
||||
class="w-64"
|
||||
@@ -141,11 +141,10 @@ import { useClipboard } from '@vueuse/core'
|
||||
const { copy, copied } = useClipboard()
|
||||
const toast = useToast()
|
||||
|
||||
const { organization, client } = useAuth()
|
||||
const organizations = computed(() => client.useListOrganizations.value?.data || [])
|
||||
const { organization } = useAuth()
|
||||
const organizations = (await organization.list()).data || []
|
||||
const { deleteOrganization: betterAuthDeleteOrganization, activeOrganization, selectedOrgId } = useBetterAuth()
|
||||
|
||||
const selectItems = computed(() => organizations.value.map((org) => ({ label: org.name, value: org.id })))
|
||||
const availableOrganizations = computed(() => organizations.map((org) => ({ label: org.name, value: org.id })))
|
||||
|
||||
watch(selectedOrgId, async (newId) => {
|
||||
const { data } = await organization.setActive({ organizationId: newId || null })
|
||||
|
||||
Reference in New Issue
Block a user