Delete session after corresponding group2session and author2session

pull/5276/head
Timon Engelke 2021-11-12 23:16:20 +01:00 committed by Richard Hansen
parent ec5f2b125f
commit 09c9e32d72
1 changed files with 3 additions and 3 deletions

View File

@ -204,9 +204,6 @@ exports.deleteSession = async (sessionID) => {
const group2sessions = await db.get(`group2sessions:${groupID}`);
const author2sessions = await db.get(`author2sessions:${authorID}`);
// remove the session
await db.remove(`session:${sessionID}`);
// remove session from group2sessions
if (group2sessions != null) { // Maybe the group was already deleted
delete group2sessions.sessionIDs[sessionID];
@ -218,6 +215,9 @@ exports.deleteSession = async (sessionID) => {
delete author2sessions.sessionIDs[sessionID];
await db.set(`author2sessions:${authorID}`, author2sessions);
}
// remove the session
await db.remove(`session:${sessionID}`);
};
exports.listSessionsOfGroup = async (groupID) => {