added endpoint for group ownership transfer

This commit is contained in:
2024-11-18 13:34:39 +03:00
parent 947dc720a5
commit 63aaa30d92
6 changed files with 26 additions and 6 deletions

View File

@@ -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();