added rename endpoint for groups
This commit is contained in:
@@ -37,6 +37,10 @@ class GroupService {
|
||||
async getUsersInGroup(groupId) {
|
||||
return (await db.query("SELECT id FROM users WHERE $1 = ANY(groups)", [groupId])).rows.map((group) => group.id)
|
||||
}
|
||||
|
||||
async rename(groupId, newName) {
|
||||
await db.query("UPDATE groups SET name = $1 WHERE id = $2", [newName, groupId]).catch((e) => errorHandler(e, "groups"));;
|
||||
}
|
||||
};
|
||||
|
||||
export default new GroupService();
|
||||
Reference in New Issue
Block a user