added endpoint for group ownership transfer
This commit is contained in:
@@ -41,6 +41,10 @@ class GroupService {
|
||||
async rename(groupId, newName) {
|
||||
await db.query("UPDATE groups SET name = $1 WHERE id = $2", [newName, groupId]).catch((e) => errorHandler(e, "groups"));;
|
||||
}
|
||||
|
||||
async transferOwnership(groupId, userId) {
|
||||
await db.query("UPDATE groups SET admin_id = $1 WHERE id = $2", [userId, groupId])
|
||||
}
|
||||
};
|
||||
|
||||
export default new GroupService();
|
||||
Reference in New Issue
Block a user