diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte
index 6dfb139fa3..287fa0f57e 100644
--- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte
+++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte
@@ -17,7 +17,6 @@
Popover,
Select,
Modal,
- ModalContent,
notifications,
StatusLight,
} from "@budibase/bbui"
@@ -29,10 +28,11 @@
import ForceResetPasswordModal from "./_components/ForceResetPasswordModal.svelte"
import { RoleUtils } from "@budibase/frontend-core"
import UserGroupPicker from "components/settings/UserGroupPicker.svelte"
+ import DeleteUserModal from "./_components/DeleteUserModal.svelte"
export let userId
- let deleteUserModal
+ let deleteModal
let resetPasswordModal
let popoverAnchor
let searchTerm = ""
@@ -83,15 +83,6 @@
: "appUser"
const userFetch = fetchData(`/api/global/users/${userId}`)
- async function deleteUser() {
- try {
- await users.delete(userId)
- notifications.success(`User ${$userFetch?.data?.email} deleted.`)
- $goto("./")
- } catch (error) {
- notifications.error("Error deleting user")
- }
- }
function getHighestRole(roles) {
let highestRole
@@ -207,9 +198,7 @@
-
+
@@ -331,19 +320,8 @@
-
-
-
- Are you sure you want to delete {$userFetch?.data?.email}
-
-
+
+
+ import { goto } from "@roxi/routify"
+ import { Body, ModalContent, notifications } from "@budibase/bbui"
+
+ import { users } from "stores/portal"
+
+ export let user
+
+ async function deleteUser() {
+ try {
+ await users.delete(user._id)
+ notifications.success(`User ${user?.email} deleted.`)
+ $goto("./")
+ } catch (error) {
+ notifications.error("Error deleting user")
+ }
+ }
+
+
+
+
+ Are you sure you want to delete {user?.email}
+
+