fix(frontend): Loading and removal of members of organization
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { LegalRole } from '~/server/utils/permissions'
|
||||
import type { ListMembersOptions } from '~/composables/useAuth'
|
||||
|
||||
export function useOrganizationApi() {
|
||||
const { organization } = useAuth()
|
||||
@@ -23,6 +24,10 @@ export function useOrganizationApi() {
|
||||
return organization.inviteMember({ email, role })
|
||||
}
|
||||
|
||||
async function removeMember(memberIdOrEmail: string) {
|
||||
return organization.removeMember({ memberIdOrEmail })
|
||||
}
|
||||
|
||||
async function acceptInvitation(invitationId: string) {
|
||||
return organization.acceptInvitation({ invitationId })
|
||||
}
|
||||
@@ -47,17 +52,23 @@ export function useOrganizationApi() {
|
||||
return organization.setActive({ organizationId })
|
||||
}
|
||||
|
||||
async function listMembers(options?: ListMembersOptions) {
|
||||
return organization.listMembers(options)
|
||||
}
|
||||
|
||||
return {
|
||||
createOrganization,
|
||||
deleteOrganization,
|
||||
getInvitation,
|
||||
listInvitations,
|
||||
inviteMember,
|
||||
removeMember,
|
||||
acceptInvitation,
|
||||
cancelSentInvitation,
|
||||
rejectInvitation,
|
||||
loadOrganizations,
|
||||
checkSlugAvailability,
|
||||
setActiveOrganization
|
||||
setActiveOrganization,
|
||||
listMembers
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user