chore: delete clan invite email when member is kicked before accepting #1370
@ -38,7 +38,11 @@ export const removeFromGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
        // TODO: Handle clan leader kicking themselves (guild should be deleted in this case, I think)
 | 
			
		||||
    } else if (guildMember.status == 2) {
 | 
			
		||||
        // Delete the inbox message for the invite
 | 
			
		||||
        await Inbox.deleteOne({ ownerId: guildMember.accountId, contextInfo: guild._id.toString() });
 | 
			
		||||
        await Inbox.deleteOne({
 | 
			
		||||
            ownerId: guildMember.accountId,
 | 
			
		||||
            contextInfo: guild._id.toString(),
 | 
			
		||||
            acceptAction: "GUILD_INVITE"
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    await GuildMember.deleteOne({ _id: guildMember._id });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user