mirror of
https://github.com/wassname/talk.git
synced 2026-08-18 12:30:39 +08:00
[CORL-139, CORL-140] Community (#2239)
* feat: Add table ui component * feat: community user table * feat: filters and role change * fix: add some comments * fix: user viewer * fix: snapshots * test: add tests * fix: better popover experience * fix: test * chore: use enum * feat: prevent server side setting your own role * fix: cleanup
This commit is contained in:
@@ -345,9 +345,14 @@ export async function updateUsername(
|
||||
export async function updateRole(
|
||||
mongo: Db,
|
||||
tenant: Tenant,
|
||||
user: Pick<User, "id">,
|
||||
userID: string,
|
||||
role: GQLUSER_ROLE
|
||||
) {
|
||||
if (user.id === userID) {
|
||||
throw new Error("cannot update your own user role");
|
||||
}
|
||||
|
||||
return updateUserRole(mongo, tenant.id, userID, role);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user