From 5a4d8dafb9e9ed4d7390ad0aee1af973e99ca527 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 1 Sep 2022 07:58:05 +0100 Subject: [PATCH] Apply validation to invite users by email + results modal --- .../builder/portal/manage/users/index.svelte | 18 +++++------------- packages/types/src/api/web/user.ts | 5 +++++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/index.svelte b/packages/builder/src/pages/builder/portal/manage/users/index.svelte index 24954e025a..c5e0353b10 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/index.svelte @@ -7,7 +7,6 @@ Table, Layout, Modal, - ModalContent, Search, notifications, Pagination, @@ -23,6 +22,7 @@ import { goto } from "@roxi/routify" import OnboardingTypeModal from "./_components/OnboardingTypeModal.svelte" import PasswordModal from "./_components/PasswordModal.svelte" + import InvitedModal from "./_components/InvitedModal.svelte" import ImportUsersModal from "./_components/ImportUsersModal.svelte" import { get } from "svelte/store" import { Constants, Utils, fetchData } from "@budibase/frontend-core" @@ -67,6 +67,8 @@ sortable: false, }, } + $: userData = [] + $: inviteUsersResponse = { successful: [], unsuccessful: [] } $: { enrichedUsers = $fetch.rows?.map(user => { let userGroups = [] @@ -112,8 +114,7 @@ groups: userData.groups, })) try { - const res = await users.invite(payload) - notifications.success(res.message) + inviteUsersResponse = await users.invite(payload) inviteConfirmationModal.show() } catch (error) { notifications.error("Error inviting user") @@ -273,16 +274,7 @@ - - - Your users should now recieve an email invite to get access to their - Budibase account - - + diff --git a/packages/types/src/api/web/user.ts b/packages/types/src/api/web/user.ts index 0ebe4ccce8..e49e520def 100644 --- a/packages/types/src/api/web/user.ts +++ b/packages/types/src/api/web/user.ts @@ -57,3 +57,8 @@ export interface CreateAdminUserRequest { password: string tenantId: string } + +export interface InviteUserRequest { + email: string + userInfo: any +}