From e02ec82ff396d9ae328d661560848b1df87ff5fd Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 18 Feb 2026 02:23:19 +0000 Subject: [PATCH] Fix a bug with moving users to different roles, still using old data structures. --- frontend/auth/admin/AdminApp.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/auth/admin/AdminApp.vue b/frontend/auth/admin/AdminApp.vue index c8c8d33..17e7e28 100644 --- a/frontend/auth/admin/AdminApp.vue +++ b/frontend/auth/admin/AdminApp.vue @@ -324,10 +324,10 @@ async function performUserDeletion(userUuid, userName, orgUuid) { } } -async function moveUserToRole(user, targetRoleUuid) { - if (user.role_uuid === targetRoleUuid) return +async function moveUserToRole(userUuid, user, targetRoleUuid) { + if (user.role === targetRoleUuid) return try { - await apiJson(`/auth/api/admin/users/${user.uuid}/role`, { + await apiJson(`/auth/api/admin/users/${userUuid}/role`, { method: 'PATCH', body: { role_uuid: targetRoleUuid } }) @@ -353,7 +353,7 @@ function onRoleDrop(e, org, role) { const data = JSON.parse(e.dataTransfer.getData('text/plain')) if (data.org !== org.uuid) return // only within same org const user = org.users[data.user_uuid] - if (user) moveUserToRole(user, role.uuid) + if (user) moveUserToRole(data.user_uuid, user, role.uuid) } catch (_) { /* ignore */ } }