diff --git a/packages/nc-gui/components/workspace/InviteSection.vue b/packages/nc-gui/components/workspace/InviteSection.vue index 0fae0eb521..7b9612b059 100644 --- a/packages/nc-gui/components/workspace/InviteSection.vue +++ b/packages/nc-gui/components/workspace/InviteSection.vue @@ -13,15 +13,6 @@ const { inviteCollaborator: _inviteCollaborator } = workspaceStore const { isInvitingCollaborators } = storeToRefs(workspaceStore) const { workspaceRoles } = useRoles() -const inviteCollaborator = async () => { - try { - await _inviteCollaborator(inviteData.email, inviteData.roles) - message.success('Invitation sent successfully') - inviteData.email = '' - } catch (e: any) { - message.error(await extractSdkResponseErrorMsg(e)) - } -} // all user input emails are stored here const emailBadges = ref>([]) watch(inviteData, (newVal) => { @@ -31,6 +22,22 @@ watch(inviteData, (newVal) => { } }) +const inviteCollaborator = async () => { + try { + let inviteEmails = '' + emailBadges.value.forEach((el) => { + inviteEmails += `${el},` + }) + + await _inviteCollaborator(inviteEmails, inviteData.roles) + message.success('Invitation sent successfully') + } catch (e: any) { + message.error(await extractSdkResponseErrorMsg(e)) + } finally { + inviteData.email = '' + emailBadges.value = [] + } +} // allow only lower roles to be assigned const allowedRoles = ref([]) @@ -53,6 +60,13 @@ onMounted(async () => {
Invite
+ { {{ email }} - - - + + + + -
@@ -88,7 +99,7 @@ onMounted(async () => { {{ isInvitingCollaborators ? 'Adding' : 'Add' }} User(s)
-
+