chore: delete clan invite email when member is kicked before accepting #1370

Merged
Sainan merged 2 commits from guild-remove-inbox into main 2025-03-29 09:48:46 -07:00
Showing only changes of commit 18fcfb4edf - Show all commits

View File

@ -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) // TODO: Handle clan leader kicking themselves (guild should be deleted in this case, I think)
} else if (guildMember.status == 2) { } else if (guildMember.status == 2) {
// Delete the inbox message for the invite // 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 }); await GuildMember.deleteOne({ _id: guildMember._id });