Fix admin users role setter name collision

This commit is contained in:
Tero Halla-aho 2025-12-06 23:23:46 +02:00
parent 27fc8ee2d1
commit 1865071bee

View file

@ -52,7 +52,7 @@ export default function AdminUsersPage() {
.catch(() => setError(t('adminRequired'))); .catch(() => setError(t('adminRequired')));
}, []); }, []);
async function setRole(userId: string, role: string) { async function setUserRole(userId: string, role: string) {
setMessage(null); setMessage(null);
setError(null); setError(null);
setLoading(true); setLoading(true);
@ -172,7 +172,7 @@ export default function AdminUsersPage() {
<tr key={u.id} style={{ borderTop: '1px solid #eee' }}> <tr key={u.id} style={{ borderTop: '1px solid #eee' }}>
<td style={{ padding: 8 }}>{u.email}</td> <td style={{ padding: 8 }}>{u.email}</td>
<td style={{ padding: 8 }}> <td style={{ padding: 8 }}>
<select value={u.role} onChange={(e) => setRole(u.id, e.target.value)} disabled={loading || role !== 'ADMIN'}> <select value={u.role} onChange={(e) => setUserRole(u.id, e.target.value)} disabled={loading || role !== 'ADMIN'}>
{roleOptions.map((r) => ( {roleOptions.map((r) => (
<option key={r} value={r}> <option key={r} value={r}>
{r} {r}