mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 00:01:37 +00:00
fix removing users
This commit is contained in:
@@ -892,8 +892,9 @@ async fn login_callback(
|
||||
if demo_exists {
|
||||
if let Err(e) = sqlx::query!(
|
||||
"INSERT INTO workspace_invite
|
||||
(workspace_id, email, is_admin)
|
||||
VALUES ('demo', $1, false)",
|
||||
(workspace_id, email, is_admin)
|
||||
VALUES ('demo', $1, false)
|
||||
ON CONFLICT DO NOTHING",
|
||||
&email
|
||||
)
|
||||
.execute(&mut tx)
|
||||
|
||||
@@ -1014,6 +1014,13 @@ async fn delete_user(
|
||||
.execute(&mut tx)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
"DELETE FROM workspace_invite WHERE email = $1",
|
||||
&email_to_delete
|
||||
)
|
||||
.execute(&mut tx)
|
||||
.await?;
|
||||
|
||||
audit_log(
|
||||
&mut tx,
|
||||
&email.unwrap(),
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import InviteGlobalUser from '$lib/components/InviteGlobalUser.svelte'
|
||||
import { Alert, Badge, Drawer, DrawerContent } from '$lib/components/common'
|
||||
import ConfirmationModal from '$lib/components/common/confirmationModal/ConfirmationModal.svelte'
|
||||
import { sendUserToast } from '$lib/utils'
|
||||
|
||||
let drawer: Drawer
|
||||
|
||||
@@ -44,6 +45,7 @@
|
||||
async function listUsers(): Promise<void> {
|
||||
users = await UserService.listUsersAsSuperAdmin({ perPage: 100000 })
|
||||
fuse?.setCollection(users)
|
||||
userFilter = userFilter
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -128,6 +130,7 @@
|
||||
on:click={async () => {
|
||||
deleteConfirmedCallback = async () => {
|
||||
await UserService.globalUserDelete({ email })
|
||||
sendUserToast(`User ${email} removed`)
|
||||
listUsers()
|
||||
}
|
||||
openConfirmation = true
|
||||
|
||||
Reference in New Issue
Block a user