also filter by acceptAction just in case
All checks were successful
Build / build (18) (push) Successful in 52s
Build / build (20) (push) Successful in 1m16s
Build / build (22) (push) Successful in 42s
Build / build (22) (pull_request) Successful in 43s
Build / build (20) (pull_request) Successful in 1m15s
Build / build (18) (pull_request) Successful in 1m30s

This commit is contained in:
Sainan 2025-03-29 17:27:20 +01:00
parent bfa992bf79
commit 18fcfb4edf

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)
} 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 });