fix: use correct user id field for admin impersonate and role change modals
The modals were using selectedUser.userId but the user object has the field named id, not userId. This caused undefined to be passed to the backend, resulting in "Invalid user ID" error when trying to impersonate or change user roles. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -486,7 +486,7 @@
|
|||||||
<button class="modal-button cancel" on:click={() => showImpersonationModal = false}>
|
<button class="modal-button cancel" on:click={() => showImpersonationModal = false}>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button class="modal-button confirm" on:click={() => handleImpersonate(selectedUser.userId)}>
|
<button class="modal-button confirm" on:click={() => handleImpersonate(selectedUser.id)}>
|
||||||
Impersonate
|
Impersonate
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -518,7 +518,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="modal-button confirm"
|
class="modal-button confirm"
|
||||||
on:click={() => handleRoleChange(selectedUser.userId, !selectedUser.isAdmin)}
|
on:click={() => handleRoleChange(selectedUser.id, !selectedUser.isAdmin)}
|
||||||
>
|
>
|
||||||
Change Role
|
Change Role
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user